All apps/Docker

Docker

docker

Builds, ships and runs applications in containers.

Runs as docker|macOS, Linux, Windows|docs.docker.com

Command form

ai-draft · 6 tasks · 38 fields

Run, inspect and build containers. Only the everyday container and image commands are covered; Compose, Swarm, contexts, plugins and registry login are left out.

Opens the form; the finished command lands at your prompt, unrun
otty gui docker

docker run

Run a container

Start a new container from an image. Resource limits, networking and security options are left out.

Run a containerExample values, fixed in this page — nothing here reaches a terminal
Basic
Image*
string
Command and arguments
string
Keep STDIN open
--interactive
Allocate a TTY
--tty
Remove when it exits
--rm
TasksEach one presets the form for one job
Interactive shell
imageinteractivettyrmcommand
Background service
imagedetachnamepublishvolumeenvrestart
ParametersOnly these flags are editable in the form
Detached
Run in the background and print the container ID.
boolean
--detach-d
Keep STDIN open
boolean
--interactive-i
Allocate a TTY
boolean
--tty-t
Remove when it exits
boolean
--rm
Container name
string
--name
Published ports
host:container, for example 8080:80.
string · repeatable
--publish-p
Volumes
host-path:container-path, optionally with :ro.
string · repeatable
--volume-v
Environment variables
KEY=value, one per entry.
string · repeatable
--env-e
Working directory
string
--workdir-w
Restart policy
string
--restartnoalwaysunless-stoppedon-failure
Privileged
boolean
--privileged
Image
For example nginx:latest.
string · positional 0
Command and arguments
Overrides the image default command.
string · positional 1 · repeatable

docker ps

List containers

List running containers, optionally filtered and formatted.

List containersExample values, fixed in this page — nothing here reaches a terminal
Basic
Filter
status=exitedstring
IDs only
--quiet
Do not truncate
--no-trunc
TasksEach one presets the form for one job
Exited containers
filterquietno_trunc
ParametersOnly these flags are editable in the form
Filter
key=value, for example status=exited.
string · repeatable
--filter-f
Format
A Go template, for example {{.Names}}.
string
--format
Last N containers
integer
--last-n
IDs only
boolean
--quiet-q
Do not truncate
boolean
--no-trunc
Show sizes
boolean
--size-s

docker logs

Container logs

Print or follow the logs of one container.

Container logsExample values, fixed in this page — nothing here reaches a terminal
Basic
Container*
string
Follow
--follow
Tail lines
100string
Timestamps
--timestamps
TasksEach one presets the form for one job
Follow recent output
containerfollowtailtimestamps
ParametersOnly these flags are editable in the form
Follow
boolean
--follow-f
Tail lines
A number of lines, or all.
string
--tail-n
Since
A timestamp or relative time such as 42m.
string
--since
Timestamps
boolean
--timestamps-t
Container
Name or ID.
string · positional 0

docker exec

Exec in a container

Run a command inside a running container.

Exec in a containerExample values, fixed in this page — nothing here reaches a terminal
Basic
Container*
string
Command and arguments
shstring
Keep STDIN open
--interactive
Allocate a TTY
--tty
TasksEach one presets the form for one job
Open a shell
containerinteractivettycommand
ParametersOnly these flags are editable in the form
Keep STDIN open
boolean
--interactive-i
Allocate a TTY
boolean
--tty-t
Environment variables
string · repeatable
--env-e
Working directory
string
--workdir-w
Container
string · positional 0
Command and arguments
For example sh, or bash -c 'ls'.
string · positional 1 · repeatable

docker build

Build an image

Build an image from a Dockerfile. Secrets, SSH, cache import and output destinations are left out.

Build an imageExample values, fixed in this page — nothing here reaches a terminal
Basic
Build context*
directory
Tag
string
Dockerfile
file
Build arguments
string
TasksEach one presets the form for one job
Build current directory
tagfilebuild_argcontext
ParametersOnly these flags are editable in the form
Tag
name:tag
string
--tag-t
Dockerfile
path
--file-f
Build arguments
KEY=value, one per entry.
string · repeatable
--build-arg
Target stage
string
--target
Platform
string
--platformlinux/amd64linux/arm64
No cache
boolean
--no-cache
Always pull base image
boolean
--pull
Build context
path · positional 0
SourcesEvery flag above is checked against these
fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

Before it fills your prompt, Otty checks the installed docker against its version. A form that does not match your version is not offered.