run

Purpose

Use run if you want to run a command with NEW containers. This is helpful for package installers, etc.

Usage

spin run [OPTIONS] SERVICE COMMAND 

Example:

spin exec php composer install

The above command runs composer install inside of the php service.

Official Documentation & Additional Options

Spin Specific Options

  • --no-pull: Do not automatically pull docker images.

Official Docker Options

This command is a shortcut for docker-compose run and can accept additional options that you pass to it.

Special notes

  • This command specifically ignores running container dependencies
  • It will automatically remove the containers once the command is complete
  • It adds extra environment variables to improve user-experience if you're running things like "S6 Overlay" inside your containers
Edit this page on GitHub Updated at Wed, Jul 6, 2022