Introduction to Docker
Last updated
Last updated
Before installing the Supra CLI, you will need to install Docker. Itβs helpful to understand what Docker is, how it works, and why we use it for this setup.
Docker is a platform that packages applications into lightweight, portable containers. These containers include everything an app needs to run: code, runtime, libraries, and environment variables.
Docker provides a consistent, repeatable environment that eliminates:
π§© OS differences (Linux, Mac, Windows)
βοΈ Dependency/version mismatches
β βIt works on my machineβ issues
With Docker, developers can run the Supra CLI in a pre-configured environment without needing to install the CLI or dependencies locally.
Docker Compose is a tool used to define and run multi-container Docker applications using a YAML file (compose.yaml
or docker-compose.yml
).
In our case, the Compose file:
Defines the container configuration for the Supra CLI
Specifies the image to use
Sets up bind mounts to share files between your machine and the container
A bind mount is a way to share directories between your host and the container.
In the Supra CLI setup:
The supra_configs/
folder on your host is bind-mounted to the configs/
folder inside the container.
This means anything you write to configs/
inside the container will appear on your host β and vice versa.
Once a container is running, you can open a terminal session inside it using:
exec
tells Docker to run a command inside an existing container.
-it
allows interactive terminal input/output.
supra_cli
is the name of the container.
/bin/bash
starts a shell session.
This is useful when you want to:
Run the Supra CLI directly (supra move tool ...
)
Explore the file system
Debug issues inside the container
docker ps --all
Lists all containers (running and stopped)
docker start <container>
Starts an existing container
docker stop <container>
Stops a running container
docker exec -it <container> /bin/bash
Enters the shell of a container
docker logs <container>
Prints logs from a container
docker rm <container>
Removes a container
docker images
Lists downloaded Docker images
docker volume ls
Lists Docker volumes (persistent storage)
docker compose up -d
Starts containers in detached (background) mode
docker compose down
Stops and removes containers, networks, and volumes
docker compose ps
Lists containers defined in your Compose file
docker compose logs
Shows logs from all Compose services
docker compose restart
Restarts all services defined in the Compose file
docker compose pull
Pulls the latest versions of images from the registry
docker compose build
Builds or rebuilds services defined in the file
Docker simplifies the Supra CLI experience by:
Eliminating setup headaches
Ensuring all developers use the same runtime
Providing isolated environments with shared config folders
If you're new to Docker, this may feel like a lot β but once set up, youβll rarely need to modify it again.