Create a container from a docker run command

Most READMEs give a docker run line. Gantry reads that line and fills the New Container form, for a Docker host or for Apple's container tool. This guide shows how, and how to convert the command by hand.

In short. In Gantry, open New Container, choose Paste Command…, paste the docker run line and click Fill Form. Gantry lists each flag that it cannot use, with the reason. For the CLI, most flags are the same: replace docker run with container run and remove --restart.

Paste the command in Gantry

  1. Select a host: a Docker host or an apple/container host.
  2. Open Containers and click New Container.
  3. Click Paste Command… and paste the line. Line ends with \, quotes, a $ prompt and sudo are all fine.
  4. Read the preview: the image, the flags that Gantry cannot use, notes, and warnings for this host.
  5. Click Fill Form, check the values, and create the container.

Gantry reads docker run, docker container run, docker create, podman run and container run. Text after &&, ||, ; or | is ignored, with a note.

Which flags fill the form

FlagForm fieldNotes
image, --name, commandImage, Name, Command
-p, --publishPortsHost IP, IPv6, udp, ranges up to 100 ports
-e, --envEnvironment-e KEY alone gives an empty value and a note
--env-fileEnvironment fileThe path is kept; the file is not read
-v, --mountVolumesBind mounts and named volumes, ro or rw
--networkNetworkA menu of the host networks
--restartRestart policyDocker hosts only
--cpus, -mCPUs, MemoryChecked inline
--entrypoint, -w, -uEntrypoint, Working directory, User
-l, --labelLabels
-d, --rm, -i, -tOptions
-c, -a, -k, --kernel-arg, --dns-domainapple/container optionsThe container run forms

About 80 other Docker flags are known: Gantry skips their values correctly and lists them as not used, so nothing is lost without a note.

Warnings for apple/container hosts

Some Docker options do not exist on apple/container. Gantry warns about them and leaves them out of the create request:

On a Docker host, Gantry warns about the apple/container options: the DNS domain and the kernel options.

Convert docker run to container run by hand

For the CLI, most flags stay the same. A Redis example:

Terminal
docker run -d --name cache --restart unless-stopped -p 6379:6379 \
  -v redisdata:/data redis:7 redis-server --appendonly yes

becomes:

Terminal
container volume create redisdata
container run -d --name cache -p 6379:6379 \
  -v redisdata:/data redis:7 redis-server --appendonly yes

Create the named volume first with container volume create. Remove --restart and round --cpus to a whole number. --platform works as in Docker.

Copy a container as a command

The other way works too. Right-click a container, or use the More menu, and choose Copy as Command: Gantry writes a docker run or container run line. It leaves out the defaults of the image, such as its environment and command, so the line stays short. This works for stopped containers as well.

Export the container as Compose

To keep a container as a file, right-click it, or use the More menu, and choose Export as Compose…. Select several containers to put them in one file. Gantry writes a docker-compose.yml with one service for each container: ports, mounts, networks, restart policy, health check, limits, capabilities and logging. Named volumes and networks are marked external: true.

Keep secrets out of the command

A -e PASSWORD=… in a command is easy to leak. In the New Container form, open the key menu of an environment row and choose Save Value in Keychain…, or pick a secret that you added in Settings → Secrets. The row then shows keychain:NAME with a lock, not the value.

Gantry reads the value from the Keychain only when it creates the container. Copy as Command, recipes and Compose export write keychain:NAME. The Inspect tab shows KEY=[REDACTED]. The engine still stores the value, so docker inspect or container inspect outside Gantry can show it.

Save it as a recipe

In the New Container sheet, open Recipes and choose Save as Recipe…. Next time, Fill from Recipe gives the same form on any host. Recipes are in ~/Library/Application Support/Gantry/recipes.json, so you can back them up or share them.

Limits

Moving a whole setup? Read Move from Docker Desktop to Apple container.

Questions and answers

How do I convert docker run to container run?

Replace docker run with container run. -d, -p, -e, -v, --name, --rm, -it, -w and --entrypoint stay the same. Remove --restart and use whole CPUs. Or paste the line in Gantry and let it fill the form.

Can Gantry import a docker run command?

Yes. Paste Command… in the New Container sheet reads docker run, docker create, podman run and container run and fills the form.

What happens to flags that Gantry does not support?

They are listed in the preview with the reason, and they stay in the form in the section From the Pasted Command, so you can check them later.

Can I turn a running container back into a docker run command?

Yes. Copy as Command in the container menu writes a docker run or container run line for that container.

Last updated 2026-11-23.