Skip to main content

Img2Num Docker Script

The img2num script is the recommended way to interact with the Docker development environment. It automatically manages the development container for you.

Automatic image selection

You normally don't need to specify a Docker image.

The script automatically:

  1. Reuses the last image you used.
  2. Falls back to the default development image if none has been selected.

The image selection flags below are only useful if you want to override this behaviour (see Selecting a Docker image).

Common commands

Open a shell

Paste this in your terminal
./img2num sh

Starts (if necessary) and opens an interactive Bash shell inside the Docker development container.

Run a command

Paste this in your terminal
./img2num run <command>

Runs a one-off command inside the Docker development container.

Example:

./img2num run just build docs

run and exec are interchangeable.

Stop the container

./img2num stop

Stops the running development container while preserving its data.

Selecting a Docker image

Most users can ignore this section.

If you need to use a different development image, you can override the automatically selected image for a single command.

--img

Use a specific Docker image.

./img2num sh --img ghcr.io/ryan-millard/img2num-dev:latest

--dh-img

Shorthand for Docker Hub images.

./img2num sh --dh-img dev

Equivalent to:

./img2num sh --img ryanmillard/img2num-dev:dev

--ghcr-img

Shorthand for GitHub Container Registry images.

./img2num sh --ghcr-img latest

Equivalent to:

./img2num sh --img ghcr.io/ryan-millard/img2num-dev:latest

More commands

The script also supports commands such as:

  • restart
  • down
  • purge
  • destroy
  • logs
  • last-image

For the complete command reference, run:

./img2num help