exec

Use `exec` if you want to run a command in **currently running** containers.

Usage

Usage for "spin exec"
spin exec [OPTIONS] SERVICE COMMAND

Example

Example of running "php artisan migrate" within the "php" container
spin exec php php artisan migrate

The above command runs php artisan migrate inside of the php service (this is why "php" is repeated twice).

Official Documentation & Additional Options

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

Special notes

This command requires the containers to already be running (start them with spin up). If your containers are not running, use spin run instead.