Skip to main content
Quickly start a set of containers from your compose project in an ephemeral environment. Removed: use nsc docker attach-context instead. run-compose no longer exists as a CLI command. The rest of this page is kept for historical reference. run-compose started a set of containers defined in a compose file in an ephemeral environment. Similar to docker-compose, nsc run-compose uses compose.yaml (preferable), compose.yml, docker-compose.yaml or docker-compose.yml file in working directory.

Usage

Example

In the following example, nsc starts containers using compose file in the current directory:
1

Start the containers

Start the containers defined in the compose file:
Output
2

Connect to the instance

Connect using the instance ID from the output:
3

Inspect the containers

List the created containers with nerdctl:
4

Expose a service

Expose any service from the compose file publicly using the nsc expose command with the flag --source containerd.

Options

—dir <dir>

To specify a working directory from where nsc loads the compose file.

—development

Specify to enables development facilities, including making containers optional.

-o <type>

Specifying run-compose command output format. Supported options are json and plain. By default plain output format is used.

—wait

Wait for all containers to start running.
Last modified on August 20, 2026