Makefile

Host-side Make targets for setting up and entering the SPLENT CLI environment.


Overview

The CLI repository ships with a Makefile that splits targets across two files:

  • makefiles/Makefile.setup — environment preparation and Docker lifecycle
  • makefiles/Makefile.cli — shortcut to enter the running container

All commands are run on the host machine, not inside the container.


Targets

make setup

Full first-time setup in one step.

make setup

Runs in sequence: env-preparedocker-upcli-enter.


make setup-rebuild

Tear down and rebuild the environment from scratch.

make setup-rebuild
  1. Stops existing containers (docker compose down -v --remove-orphans)
  2. Removes old Docker images (docker image prune -a -f)
  3. Rebuilds images without cache (docker compose build --no-cache)
  4. Starts fresh containers
  5. Enters the CLI shell

Use this when the Docker image is stale or after major dependency changes.


make env-prepare

Initialises the .env file from the example template.

make env-prepare
  • Copies .env.example../.env if it does not already exist.
  • Injects SPLENT_HOST_PROJECT_DIR automatically:
    • Local machine: uses the real absolute path of the workspace.
    • Vagrant: injects /workspace instead.

Safe to run multiple times — skips the copy if .env already exists.


make docker-up

Starts the Docker Compose stack.

make docker-up

Equivalent to:

HOST_UID=<uid> HOST_GID=<gid> docker compose -f docker/docker-compose.yml up -d

The host user’s UID/GID are forwarded so file permissions inside the container match the host.


make cli-enter

Enters the running CLI container as the splent user.

make cli-enter

Uses setpriv to drop into the splent user session with the correct UID, GID, and Docker socket group. Loads /home/splent/.bashrc so the full shell environment is available.


make cli

Alias for cli-enter. Shorter to type during day-to-day work.

make cli

Typical workflows

First time:

make setup

Day-to-day (containers already running):

make cli

After changing Docker config or dependencies:

make setup-rebuild

Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es