spin up

Bring up all containers defined in docker-compose.yml and docker-compose.$SPIN_ENV.yml ($SPIN_ENV defaults to dev).

Usage

Usage for "spin up"

spin up [OPTIONS]

Example

Force a build of containers on initialization

spin up --build

You can add options at the end of the command (like the --build shown above. The above command will bring up your containers, but then also force a new build (if you have builds configured in your "docker-compose.dev.yml" file).

Defaults

The spin up command defaults to running:

Command default

COMPOSE_FILE=docker-compose.yml:docker-compose.dev.yml docker compose up

Official Documentation & Additional Options

Spin Specific Options

  • --skip-pull: Do not automatically pull docker images.
  • --force-pull: Pull Docker Compose images, regardless of cache settings.

Official Docker Options

This command is a shortcut for docker compose up and can accept additional options that you pass to it. It also does a number of other special things.

Special notes

  • Make sure to have a docker-compose.yml and by default a docker-compose.dev.yml in your project before running
  • Spin will automatically pull image updates (only if the machine is connected to the Internet)
  • Spin will remove any orphan containers

Overriding the environment with $SPIN_ENV

Let's say you have a few different files in your repository:

Example project root

.
├── docker-compose.ci.yml
├── docker-compose.production.yml
├── docker-compose.staging.yml
├── docker-compose.testing.yml
└── docker-compose.yml

By default, Spin uses docker-compose.yml and docker-compose.dev.yml.

If you want to change that, you just need to set $SPIN_ENV:

Change spin environment

SPIN_ENV=testing spin up

This will essentially run:

Above command will execute this below

COMPOSE_FILE=docker-compose.yml:docker-compose.testing.yml docker compose up