[โฌ๏ธ Download] [๐ Command reference] [โFAQs & Troubleshooting] [๐ Additional documents]
nerdctl
is a Docker-compatible CLI for containerd.
โ
Same UI/UX as docker
โ
Supports Docker Compose (nerdctl compose up
)
โ [Optional] Supports rootless mode, without slirp overhead (bypass4netns)
โ [Optional] Supports lazy-pulling (Stargz)
โ [Optional] Supports encrypted images (ocicrypt)
โ [Optional] Supports P2P image distribution (IPFS) (*1)
โ [Optional] Supports container image signing and verifying (cosign)
nerdctl is a non-core sub-project of containerd.
*1: P2P image distribution (IPFS) is completely optional. Your host is NOT connected to any P2P network, unless you opt in to install and run IPFS daemon.
To run a container with the default bridge
CNI network (10.4.0.0/24):
# nerdctl run -it --rm alpine
To build an image using BuildKit:
# nerdctl build -t foo /some-dockerfile-directory
# nerdctl run -it --rm foo
To build and send output to a local directory using BuildKit:
# nerdctl build -o type=local,dest=. /some-dockerfile-directory
To run containers from docker-compose.yaml
:
# nerdctl compose -f ./examples/compose-wordpress/docker-compose.yaml up
See also ./examples/compose-wordpress
.
To list local Kubernetes containers:
# nerdctl --namespace k8s.io ps -a
To build an image for local Kubernetes without using registry:
# nerdctl --namespace k8s.io build -t foo /some-dockerfile-directory
# kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
name: foo
spec:
containers:
- name: foo
image: foo
imagePullPolicy: Never
EOF
To load an image archive (docker save
format or OCI format) into local Kubernetes:
# nerdctl --namespace k8s.io load < /path/to/image.tar
To launch rootless containerd:
$ containerd-rootless-setuptool.sh install
To run a container with rootless containerd:
$ nerdctl run -d -p 8080:80 --name nginx nginx:alpine
See ./docs/rootless.md
.
Binaries are available here: https://github.com/containerd/nerdctl/releases
In addition to containerd, the following components should be installed:
- CNI plugins: for using
nerdctl run
.- v1.1.0 or later is highly recommended. Older versions require extra CNI isolation plugin for isolating bridge networks (
nerdctl network create
).
- v1.1.0 or later is highly recommended. Older versions require extra CNI isolation plugin for isolating bridge networks (
- BuildKit (OPTIONAL): for using
nerdctl build
. BuildKit daemon (buildkitd
) needs to be running. See also the document about setting up BuildKit. - RootlessKit and slirp4netns (OPTIONAL): for Rootless mode
- RootlessKit needs to be v0.10.0 or later. v0.14.1 or later is recommended.
- slirp4netns needs to be v0.4.0 or later. v1.1.7 or later is recommended.
These dependencies are included in nerdctl-full-<VERSION>-<OS>-<ARCH>.tar.gz
, but not included in nerdctl-<VERSION>-<OS>-<ARCH>.tar.gz
.
On Linux systems you can install nerdctl via brew:
brew install nerdctl
This is currently not supported for macOS. The section below shows how to install on macOS using brew.
Lima project provides Linux virtual machines for macOS, with built-in integration for nerdctl.
$ brew install lima
$ limactl start
$ lima nerdctl run -d --name nginx -p 127.0.0.1:8080:80 nginx:alpine
See ./docs/freebsd.md
.
- Linux containers: Known to work on WSL2
- Windows containers: experimental support for Windows (see below for features that are currently known to work)
To run containerd and nerdctl inside Docker:
docker build -t nerdctl .
docker run -it --rm --privileged nerdctl
The goal of nerdctl
is to facilitate experimenting the cutting-edge features of containerd that are not present in Docker.
Such features include, but not limited to, on-demand image pulling (lazy-pulling) and image encryption/decryption.
Note that competing with Docker is not the goal of nerdctl
. Those cutting-edge features are expected to be eventually available in Docker as well.
Also, nerdctl
might be potentially useful for debugging Kubernetes clusters, but it is not the primary goal.
Major:
- On-demand image pulling (lazy-pulling) using Stargz Snapshotter:
nerdctl --snapshotter=stargz run IMAGE
. - Image encryption and decryption using ocicrypt (imgcrypt):
nerdctl image (encrypt|decrypt) SRC DST
- P2P image distribution using IPFS:
nerdctl run ipfs://CID
. P2P image distribution (IPFS) is completely optional. Your host is NOT connected to any P2P network, unless you opt in to install and run IPFS daemon. - Recursive read-only (RRO) bind-mount:
nerdctl run -v /mnt:/mnt:rro
(make children such as/mnt/usb
to be read-only, too). Requires kernel >= 5.12, and crun >= 1.4 or runc >= 1.1 (PR #3272). - Cosign integration:
nerdctl pull --verify=cosign
andnerdctl push --sign=cosign
- Accelerated rootless containers using bypass4netns:
nerdctl run --label nerdctl/bypass4netns=true
Minor:
- Namespacing:
nerdctl --namespace=<NS> ps
. (NOTE: All Kubernetes containers are in thek8s.io
containerd namespace regardless to Kubernetes namespaces) - Exporting Docker/OCI dual-format archives:
nerdctl save
. - Importing OCI archives as well as Docker archives:
nerdctl load
. - Specifying a non-image rootfs:
nerdctl run -it --rootfs <ROOTFS> /bin/sh
. The CLI syntax conforms to Podman convention. - Connecting a container to multiple networks at once:
nerdctl run --net foo --net bar
- Running FreeBSD jails.
- Better multi-platform support, e.g.,
nerdctl pull --all-platforms IMAGE
- Applying an (existing) AppArmor profile to rootless containers:
nerdctl run --security-opt apparmor=<PROFILE>
. Usesudo nerdctl apparmor load
to load thenerdctl-default
profile.
Trivial:
- Inspecting raw OCI config:
nerdctl container inspect --mode=native
.
-
ctr
: incompatible with Docker CLI, and not friendly to users. Notably,ctr
lacks the equivalents of the following nerdctl commands:nerdctl run -p <PORT>
nerdctl run --restart=always --net=bridge
nerdctl pull
with~/.docker/config.json
and credential helper binaries such asdocker-credential-ecr-login
nerdctl logs
nerdctl build
nerdctl compose up
-
crictl
: incompatible with Docker CLI, not friendly to users, and does not support non-CRI features -
k3c v0.2 (abandoned): needs an extra daemon, and does not support non-CRI features
-
Rancher Kim (nee k3c v0.3): needs Kubernetes, and only focuses on image management commands such as
kim build
andkim push
-
PouchContainer (abandoned?): needs an extra daemon
nerdctl is a containerd non-core sub-project, licensed under the Apache 2.0 license. As a containerd non-core sub-project, you will find the:
information in our containerd/project
repository.
Tips: You should make your Go toolchain newer than 1.17.
Run make && sudo make install
.
Using go install github.com/containerd/nerdctl/cmd/nerdctl
is possible, but unrecommended because it does not fill version strings printed in nerdctl version
Run go test -v ./pkg/...
Run go test -exec sudo -v ./cmd/nerdctl/...
after make && sudo make install
.
For testing rootless mode, -exec sudo
is not needed.
To run tests in a container:
docker build -t test-integration --target test-integration .
docker run -t --rm --privileged test-integration
Run go test -exec sudo -v ./cmd/nerdctl/... -args -test.target=docker
to ensure that the test suite is compatible with Docker.
Lots of commands and flags are currently missing. Pull requests are highly welcome.
Please certify your Developer Certificate of Origin (DCO), by signing off your commit with git commit -s
and with your real name.
๐ณ = Docker compatible
๐ค = nerdctl specific
๐ฆ = Windows enabled
Unlisted docker
CLI flags are unimplemented yet in nerdctl
CLI.
It does not necessarily mean that the corresponding features are missing in containerd.
- Container management
- ๐ณ ๐ฆ nerdctl run
- ๐ณ ๐ฆ nerdctl exec
- ๐ณ ๐ฆ nerdctl create
- ๐ณ nerdctl cp
- ๐ณ ๐ฆ nerdctl ps
- ๐ณ ๐ฆ nerdctl inspect
- ๐ณ nerdctl logs
- ๐ณ nerdctl port
- ๐ณ nerdctl rm
- ๐ณ nerdctl stop
- ๐ณ nerdctl start
- ๐ณ nerdctl restart
- ๐ณ nerdctl update
- ๐ณ nerdctl wait
- ๐ณ nerdctl kill
- ๐ณ nerdctl pause
- ๐ณ nerdctl unpause
- Build
- Image management
- Registry
- Network management
- Volume management
- Namespace management
- AppArmor profile management
- Builder management
- System
- Stats
- Shell completion
- Compose
- IPFS management
- Global flags
- Unimplemented Docker commands
- Additional documents
Run a command in a new container.
Usage: nerdctl run [OPTIONS] IMAGE [COMMAND] [ARG...]
๐ค ipfs://
prefix can be used for IMAGE
to pull it from IPFS. See /docs/ipfs.md
for details.
Basic flags:
- ๐ณ ๐ฆ
-i, --interactive
: Keep STDIN open even if not attached" - ๐ณ ๐ฆ
-t, --tty
: Allocate a pseudo-TTYโ ๏ธ WIP: currently-t
conflicts with-d
- ๐ณ ๐ฆ
-d, --detach
: Run container in background and print container ID - ๐ณ
--restart=(no|always|on-failure|unless-stopped)
: Restart policy to apply when a container exits- Default: "no"
- always: Always restart the container if it stops.
- on-failure[:max-retries]: Restart only if the container exits with a non-zero exit status. Optionally, limit the number of times attempts to restart the container using the :max-retries option.
- unless-stopped: Always restart the container unless it is stopped.
- ๐ณ
--rm
: Automatically remove the container when it exits - ๐ณ
--pull=(always|missing|never)
: Pull image before running- Default: "missing"
- ๐ณ
--pid=(host)
: PID namespace to use - ๐ณ
--stop-signal
: Signal to stop a container (default "SIGTERM") - ๐ณ
--stop-timeout
: Timeout (in seconds) to stop a container
Platform flags:
- ๐ณ
--platform=(amd64|arm64|...)
: Set platform
Init process flags:
- ๐ณ
--init
: Run an init inside the container that forwards signals and reaps processes. - ๐ค
--init-binary=<binary-name>
: The custom init binary to use. We suggest you use the tini binary which is used in Docker project to get the same behavior. Please make sure the binary exists in yourPATH
.- Default:
tini
- Default:
Network flags:
- ๐ณ
--net, --network=(bridge|host|none|<CNI>)
: Connect a container to a network- Default: "bridge"
- ๐ค Unlike Docker, this flag can be specified multiple times (
--net foo --net bar
)
- ๐ณ
-p, --publish
: Publish a container's port(s) to the host - ๐ณ
--dns
: Set custom DNS servers - ๐ณ
--dns-search
: Set custom DNS search domains - ๐ณ
--dns-opt, --dns-option
: Set DNS options - ๐ณ
-h, --hostname
: Container host name - ๐ณ
--add-host
: Add a custom host-to-IP mapping (host:ip) - ๐ณ
--ip
: Specific static IP address(es) to use
Cgroup flags:
- ๐ณ
--cpus
: Number of CPUs - ๐ณ
--cpu-quota
: Limit the CPU CFS (Completely Fair Scheduler) quota - ๐ณ
--cpu-period
: Limit the CPU CFS (Completely Fair Scheduler) period - ๐ณ
--cpu-shares
: CPU shares (relative weight) - ๐ณ
--cpuset-cpus
: CPUs in which to allow execution (0-3, 0,1) - ๐ณ
--cpuset-mems
: Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems - ๐ณ
--memory
: Memory limit - ๐ณ
--memory-reservation
: Memory soft limit - ๐ณ
--memory-swap
: Swap limit equal to memory plus swap: '-1' to enable unlimited swap - ๐ณ
--memory-swappiness
: Tune container memory swappiness (0 to 100) (default -1) - ๐ณ
--oom-kill-disable
: Disable OOM Killer - ๐ณ
--pids-limit
: Tune container pids limit - ๐ค
--cgroup-conf
: Configure cgroup v2 (key=value) - ๐ณ
blkio-weight
: Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) - ๐ณ
--cgroupns=(host|private)
: Cgroup namespace to use- Default: "private" on cgroup v2 hosts, "host" on cgroup v1 hosts
- ๐ณ
--device
: Add a host device to the container
Intel RDT flags:
- ๐ค
--rdt-class=CLASS
: Name of the RDT class (or CLOS) to associate the container wit
User flags:
- ๐ณ ๐ฆ
-u, --user
: Username or UID (format: <name|uid>[:<group|gid>]) - ๐ค
--umask
: Set the umask inside the container. Defaults to 0022. Corresponds to Podman CLI. - ๐ณ
--group-add
: Add additional groups to join
Security flags:
- ๐ณ
--security-opt seccomp=<PROFILE_JSON_FILE>
: specify custom seccomp profile - ๐ณ
--security-opt apparmor=<PROFILE>
: specify custom AppArmor profile - ๐ณ
--security-opt no-new-privileges
: disallow privilege escalation, e.g., setuid and file capabilities - ๐ณ
--cap-add=<CAP>
: Add Linux capabilities - ๐ณ
--cap-drop=<CAP>
: Drop Linux capabilities - ๐ณ
--privileged
: Give extended privileges to this container
Runtime flags:
- ๐ณ
--runtime
: Runtime to use for this container, e.g. "crun", or "io.containerd.runsc.v1". - ๐ณ
--sysctl
: Sysctl options, e.g "net.ipv4.ip_forward=1"
Volume flags:
- ๐ณ ๐ฆ
-v, --volume <SRC>:<DST>[:<OPT>]
: Bind mount a volume, e.g.,-v /mnt:/mnt:rro,rprivate
- ๐ณ option
rw
: Read/Write (when writable) - ๐ณ option
ro
: Non-recursive read-only - ๐ค option
rro
: Recursive read-only. Should be used in conjunction withrprivate
. e.g.,-v /mnt:/mnt:rro,rprivate
makes children such as/mnt/usb
to be read-only, too. Requires kernel >= 5.12, and crun >= 1.4 or runc >= 1.1 (PR #3272). With older runc,rro
just works asro
. - ๐ณ option
shared
,slave
,private
: Non-recursive "shared" / "slave" / "private" propagation - ๐ณ option
rshared
,rslave
,rprivate
: Recursive "shared" / "slave" / "private" propagation - ๐ค option
bind
: Not-recursively bind-mounted - ๐ค option
rbind
: Recursively bind-mounted
- ๐ณ option
- ๐ณ
--tmpfs
: Mount a tmpfs directory, e.g.--tmpfs /tmp:size=64m,exec
. - ๐ณ
--mount
: Attach a filesystem mount to the container. Consists of multiple key-value pairs, separated by commas and each consisting of a<key>=<value>
tuple. e.g.,-- mount type=bind,source=/src,target=/app,bind-propagation=shared
.- ๐ณ
type
: Current supported mount types arebind
,volume
,tmpfs
. The defaul type will be set tovolume
if not specified. i.e.,--mount src=vol-1,dst=/app,readonly
equals--mount type=volum,src=vol-1,dst=/app,readonly
- Common Options:
- ๐ณ
src
,source
: Mount source spec for bind and volume. Mandatory for bind. - ๐ณ
dst
,destination
,target
: Mount destination spec. - ๐ณ
readonly
,ro
,rw
,rro
: Filesystem permissinos.
- ๐ณ
- Options specific to
bind
:- ๐ณ
bind-propagation
:shared
,slave
,private
,rshared
,rslave
, orrprivate
(default). - ๐ณ
bind-nonrecursive
:true
orfalse
(default). If set to true, submounts are not recursively bind-mounted. This option is useful for readonly bind mount. - unimplemented options:
consistency
- ๐ณ
- Options specific to
tmpfs
:- ๐ณ
tmpfs-size
: Size of the tmpfs mount in bytes. Unlimited by default. - ๐ณ
tmpfs-mode
: File mode of the tmpfs in octal. Defaults to1777
or world-writable.
- ๐ณ
- Options specific to
volume
:- unimplemented options:
volume-nocopy
,volume-label
,volume-driver
,volume-opt
- unimplemented options:
- ๐ณ
Rootfs flags:
- ๐ณ
--read-only
: Mount the container's root filesystem as read only - ๐ค
--rootfs
: The first argument is not an image but the rootfs to the exploded container. Corresponds to Podman CLI.
Env flags:
- ๐ณ ๐ฆ
--entrypoint
: Overwrite the default ENTRYPOINT of the image - ๐ณ ๐ฆ
-w, --workdir
: Working directory inside the container - ๐ณ ๐ฆ
-e, --env
: Set environment variables - ๐ณ ๐ฆ
--env-file
: Set environment variables from file
Metadata flags:
- ๐ณ ๐ฆ
--name
: Assign a name to the container - ๐ณ ๐ฆ
-l, --label
: Set meta data on a container - ๐ณ ๐ฆ
--label-file
: Read in a line delimited file of labels - ๐ณ ๐ฆ
--cidfile
: Write the container ID to the file - ๐ค
--pidfile
: file path to write the task's pid. The CLI syntax conforms to Podman convention.
Logging flags:
- ๐ณ
--log-driver=(json-file|journald|fluentd)
: Logging driver for the container (defaultjson-file
).- ๐ณ
--log-driver=json-file
: The logs are formatted as JSON. The default logging driver for nerdctl.- The
json-file
logging driver supports the following logging options:- ๐ณ
--log-opt=max-size=<MAX-SIZE>
: The maximum size of the log before it is rolled. A positive integer plus a modifier representing the unit of measure (k, m, or g). Defaults to unlimited. - ๐ณ
--log-opt=max-file=<MAX-FILE>
: The maximum number of log files that can be present. If rolling the logs creates excess files, the oldest file is removed. Only effective whenmax-size
is also set. A positive integer. Defaults to 1.
- ๐ณ
- The
- ๐ณ
--log-driver=journald
: Writes log messages tojournald
. Thejournald
daemon must be running on the host machine.- ๐ณ
--log-opt=tag=<TEMPLATE>
: Specify template to setSYSLOG_IDENTIFIER
value in journald logs.
- ๐ณ
- ๐ณ
--log-driver=fluentd
: Writes log messages tofluentd
. Thefluentd
daemon must be running on the host machine.- The
fluentd
logging driver supports the following logging options:- ๐ณ
--log-opt=fluentd-address=<ADDRESS>
: The address of thefluentd
daemon, tcp(default) and unix sockets are supported.. - ๐ณ
--log-opt=fluentd-async=<true|false>
: Enable async mode for fluentd. The default value is false. - ๐ณ
--log-opt=fluentd-buffer-limit=<LIMIT>
: The buffer limit for fluentd. If the buffer is full, the call to record logs will fail. The default is 8192. (https://github.com/fluent/fluent-logger-golang/tree/master#bufferlimit) - ๐ณ
--log-opt=fluentd-retry-wait=<1s|1ms>
: The time to wait before retrying to send logs to fluentd. The default value is 1s. - ๐ณ
--log-opt=fluentd-max-retries=<1>
: The maximum number of retries to send logs to fluentd. The default value is MaxInt32. - ๐ณ
--log-opt=fluentd-sub-second-precision=<true|false>
: Enable sub-second precision for fluentd. The default value is false. - ๐ค
--log-opt=fluentd-async-reconnect-interval=<1s|1ms>
: The time to wait before retrying to reconnect to fluentd. The default value is 0s. - ๐ค
--log-opt=fluentd-request-ack=<true|false>
: Enable request ack for fluentd. The default value is false.
- ๐ณ
- The
- ๐ณ
Shared memory flags:
- ๐ณ
--ipc
: IPC namespace to use - ๐ณ
--shm-size
: Size of/dev/shm
GPU flags:
- ๐ณ
--gpus
: GPU devices to add to the container ('all' to pass all GPUs). Please see also ./docs/gpu.md for details.
Ulimit flags:
- ๐ณ
--ulimit
: Set ulimit
Verify flags:
- ๐ค
--verify
: Verify the image (none|cosign). Seedocs/cosign.md
for details. - ๐ค
--cosign-key
: Path to the public key file, KMS, URI or Kubernetes Secret for--verify=cosign
Other docker run
flags are on plan but unimplemented yet.
Click here to show all the `docker run` flags (Docker 20.10)
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
Run a command in a new container
Options:
--add-host list Add a custom host-to-IP mapping (host:ip)
-a, --attach list Attach to STDIN, STDOUT or STDERR
--blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
--blkio-weight-device list Block IO weight (relative device weight) (default [])
--cap-add list Add Linux capabilities
--cap-drop list Drop Linux capabilities
--cgroup-parent string Optional parent cgroup for the container
--cgroupns string Cgroup namespace to use (host|private)
'host': Run the container in the Docker host's cgroup namespace
'private': Run the container in its own private cgroup namespace
'': Use the cgroup namespace as configured by the
default-cgroupns-mode option on the daemon (default)
--cidfile string Write the container ID to the file
--cpu-period int Limit CPU CFS (Completely Fair Scheduler) period
--cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota
--cpu-rt-period int Limit CPU real-time period in microseconds
--cpu-rt-runtime int Limit CPU real-time runtime in microseconds
-c, --cpu-shares int CPU shares (relative weight)
--cpus decimal Number of CPUs
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
-d, --detach Run container in background and print container ID
--detach-keys string Override the key sequence for detaching a container
--device list Add a host device to the container
--device-cgroup-rule list Add a rule to the cgroup allowed devices list
--device-read-bps list Limit read rate (bytes per second) from a device (default [])
--device-read-iops list Limit read rate (IO per second) from a device (default [])
--device-write-bps list Limit write rate (bytes per second) to a device (default [])
--device-write-iops list Limit write rate (IO per second) to a device (default [])
--disable-content-trust Skip image verification (default true)
--dns list Set custom DNS servers
--dns-option list Set DNS options
--dns-search list Set custom DNS search domains
--domainname string Container NIS domain name
--entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env list Set environment variables
--env-file list Read in a file of environment variables
--expose list Expose a port or a range of ports
--gpus gpu-request GPU devices to add to the container ('all' to pass all GPUs)
--group-add list Add additional groups to join
--health-cmd string Command to run to check health
--health-interval duration Time between running the check (ms|s|m|h) (default 0s)
--health-retries int Consecutive failures needed to report unhealthy
--health-start-period duration Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)
--health-timeout duration Maximum time to allow one check to run (ms|s|m|h) (default 0s)
--help Print usage
-h, --hostname string Container host name
--init Run an init inside the container that forwards signals and reaps processes
-i, --interactive Keep STDIN open even if not attached
--ip string IPv4 address (e.g., 172.30.100.104)
--ip6 string IPv6 address (e.g., 2001:db8::33)
--ipc string IPC mode to use
--isolation string Container isolation technology
--kernel-memory bytes Kernel memory limit
-l, --label list Set meta data on a container
--label-file list Read in a line delimited file of labels
--link list Add link to another container
--link-local-ip list Container IPv4/IPv6 link-local addresses
--log-driver string Logging driver for the container
--log-opt list Log driver options
--mac-address string Container MAC address (e.g., 92:d0:c6:0a:29:33)
-m, --memory bytes Memory limit
--memory-reservation bytes Memory soft limit
--memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable unlimited swap
--memory-swappiness int Tune container memory swappiness (0 to 100) (default -1)
--mount mount Attach a filesystem mount to the container
--name string Assign a name to the container
--network network Connect a container to a network
--network-alias list Add network-scoped alias for the container
--no-healthcheck Disable any container-specified HEALTHCHECK
--oom-kill-disable Disable OOM Killer
--oom-score-adj int Tune host's OOM preferences (-1000 to 1000)
--pid string PID namespace to use
--pids-limit int Tune container pids limit (set -1 for unlimited)
--platform string Set platform if server is multi-platform capable
--privileged Give extended privileges to this container
-p, --publish list Publish a container's port(s) to the host
-P, --publish-all Publish all exposed ports to random ports
--pull string Pull image before running ("always"|"missing"|"never") (default "missing")
--read-only Mount the container's root filesystem as read only
--restart string Restart policy to apply when a container exits (default "no")
--rm Automatically remove the container when it exits
--runtime string Runtime to use for this container
--security-opt list Security Options
--shm-size bytes Size of /dev/shm
--sig-proxy Proxy received signals to the process (default true)
--stop-signal string Signal to stop a container (default "SIGTERM")
--stop-timeout int Timeout (in seconds) to stop a container
--storage-opt list Storage driver options for the container
--sysctl map Sysctl options (default map[])
--tmpfs list Mount a tmpfs directory
-t, --tty Allocate a pseudo-TTY
--ulimit ulimit Ulimit options (default [])
-u, --user string Username or UID (format: <name|uid>[:<group|gid>])
--userns string User namespace to use
--uts string UTS namespace to use
-v, --volume list Bind mount a volume
--volume-driver string Optional volume driver for the container
--volumes-from list Mount volumes from the specified container(s)
-w, --workdir string Working directory inside the container
Run a command in a running container.
Usage: nerdctl exec [OPTIONS] CONTAINER COMMAND [ARG...]
Flags:
- ๐ณ
-i, --interactive
: Keep STDIN open even if not attached - ๐ณ
-t, --tty
: Allocate a pseudo-TTYโ ๏ธ WIP: currently-t
conflicts with-d
- ๐ณ
-d, --detach
: Detached mode: run command in the background - ๐ณ
-w, --workdir
: Working directory inside the container - ๐ณ
-e, --env
: Set environment variables - ๐ณ
--env-file
: Set environment variables from file - ๐ณ
--privileged
: Give extended privileges to the command - ๐ณ
-u, --user
: Username or UID (format: <name|uid>[:<group|gid>])
Unimplemented docker exec
flags: --detach-keys
Create a new container.
Usage: nerdctl create [OPTIONS] IMAGE [COMMAND] [ARG...]
๐ค ipfs://
prefix can be used for IMAGE
to pull it from IPFS. See /docs/ipfs.md
for details.
The nerdctl create
command similar to nerdctl run -d
except the container is never started. You can then use the nerdctl start <container_id>
command to start the container at any point.
Copy files/folders between a running container and the local filesystem
Usage:
nerdctl cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
nerdctl cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH
nerdctl cp
is designed only for use with trusted, cooperating containers.
Using nerdctl cp
with untrusted or malicious containers is unsupported and may not provide protection against unexpected behavior.
Flags:
- ๐ณ
-L, --follow-link
Always follow symbol link in SRC_PATH.
Unimplemented docker cp
flags: --archive
List containers.
Usage: nerdctl ps [OPTIONS]
Flags:
- ๐ณ
-a, --all
: Show all containers (default shows just running) - ๐ณ
--no-trunc
: Don't truncate output - ๐ณ
-q, --quiet
: Only display container IDs - ๐ณ
--format
: Format the output using the given Go template- ๐ณ
--format=table
(default): Table - ๐ณ
--format='{{json .}}'
: JSON - ๐ค
--format=wide
: Wide table - ๐ค
--format=json
: Alias of--format='{{json .}}'
- ๐ณ
- ๐ณ
-n, --last
: Show n last created containers (includes all states) - ๐ณ
-l, --latest
: Show the latest created container (includes all states)
Unimplemented docker ps
flags: --filter
, --size
Display detailed information on one or more containers.
Usage: nerdctl inspect [OPTIONS] NAME|ID [NAME|ID...]
Flags:
- ๐ค
--mode=(dockercompat|native)
: Inspection mode. "native" produces more information. - ๐ณ
--format
: Format the output using the given Go template, e.g,{{json .}}
- ๐ณ
--type
: Return JSON for specified type
Unimplemented docker inspect
flags: --size
Fetch the logs of a container.
nerdctl run -d
are supported.
Usage: nerdctl logs [OPTIONS] CONTAINER
Flags:
- ๐ณ
--f, --follow
: Follow log output - ๐ณ
--since
: Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) - ๐ณ
--until
: Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) - ๐ณ
-t, --timestamps
: Show timestamps - ๐ณ
-n, --tail
: Number of lines to show from the end of the logs (default "all")
Unimplemented docker logs
flags: --details
List port mappings or a specific mapping for the container.
Usage: nerdctl port CONTAINER [PRIVATE_PORT[/PROTO]]
Remove one or more containers.
Usage: nerdctl rm [OPTIONS] CONTAINER [CONTAINER...]
Flags:
- ๐ณ
-f, --force
: Force the removal of a running|paused|unknown container (uses SIGKILL) - ๐ณ
-v, --volumes
: Remove anonymous volumes associated with the container
Unimplemented docker rm
flags: --link
Stop one or more running containers.
Usage: nerdctl stop [OPTIONS] CONTAINER [CONTAINER...]
Flags:
- ๐ณ
-t, --time=SECONDS
: Seconds to wait for stop before killing it (default "10")
Start one or more running containers.
Usage: nerdctl start [OPTIONS] CONTAINER [CONTAINER...]
Flags:
- ๐ณ
-a, --attach
: Attach STDOUT/STDERR and forward signals
Unimplemented docker start
flags: --checkpoint
, --checkpoint-dir
, --detach-keys
, --interactive
Restart one or more running containers.
Usage: nerdctl restart [OPTIONS] CONTAINER [CONTAINER...]
Flags:
- ๐ณ
-t, --time=SECONDS
: Seconds to wait for stop before killing it (default "10")
Update configuration of one or more containers.
Usage: nerdctl update [OPTIONS] CONTAINER [CONTAINER...]
- ๐ณ
--cpus
: Number of CPUs - ๐ณ
--cpu-quota
: Limit the CPU CFS (Completely Fair Scheduler) quota - ๐ณ
--cpu-period
: Limit the CPU CFS (Completely Fair Scheduler) period - ๐ณ
--cpu-shares
: CPU shares (relative weight) - ๐ณ
--cpuset-cpus
: CPUs in which to allow execution (0-3, 0,1) - ๐ณ
--cpuset-mems
: Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems - ๐ณ
--memory
: Memory limit - ๐ณ
--memory-reservation
: Memory soft limit - ๐ณ
--memory-swap
: Swap limit equal to memory plus swap: '-1' to enable unlimited swap - ๐ณ
--pids-limit
: Tune container pids limit
Block until one or more containers stop, then print their exit codes.
Usage: nerdctl wait CONTAINER [CONTAINER...]
Kill one or more running containers.
Usage: nerdctl kill [OPTIONS] CONTAINER [CONTAINER...]
Flags:
- ๐ณ
-s, --signal
: Signal to send to the container (default: "KILL")
Pause all processes within one or more containers.
Usage: nerdctl pause CONTAINER [CONTAINER...]
Unpause all processes within one or more containers.
Usage: nerdctl unpause CONTAINER [CONTAINER...]
Rename a container.
Usage: nerdctl rename CONTAINER NEW_NAME
Build an image from a Dockerfile.
โน๏ธ Needs buildkitd to be running. See also the document about setting up nerdctl build
with BuildKit.
Usage: nerdctl build [OPTIONS] PATH
Flags:
- ๐ค
--buildkit-host=<BUILDKIT_HOST>
: BuildKit address - ๐ณ
-t, --tag
: Name and optionally a tag in the 'name:tag' format - ๐ณ
-f, --file
: Name of the Dockerfile - ๐ณ
--target
: Set the target build stage to build - ๐ณ
--build-arg
: Set build-time variables - ๐ณ
--no-cache
: Do not use cache when building the image - ๐ณ
--output=OUTPUT
: Output destination (format: type=local,dest=path)- ๐ณ
type=local,dest=path/to/output-dir
: Local directory - ๐ณ
type=oci[,dest=path/to/output.tar]
: Docker/OCI dual-format tar ball (compatible withdocker buildx build
) - ๐ณ
type=docker[,dest=path/to/output.tar]
: Docker format tar ball (compatible withdocker buildx build
) - ๐ณ
type=tar[,dest=path/to/output.tar]
: Raw tar ball - ๐ณ
type=image,name=example.com/image,push=true
: Push to a registry (seebuildctl build
documentation)
- ๐ณ
- ๐ณ
--progress=(auto|plain|tty)
: Set type of progress output (auto, plain, tty). Use plain to show container output - ๐ณ
--secret
: Secret file to expose to the build: id=mysecret,src=/local/secret - ๐ณ
--ssh
: SSH agent socket or keys to expose to the build (format:default|<id>[=<socket>|<key>[,<key>]]
) - ๐ณ
-q, --quiet
: Suppress the build output and print image ID on success - ๐ณ
--cache-from=CACHE
: External cache sources (eg. user/app:cache, type=local,src=path/to/dir) (compatible withdocker buildx build
) - ๐ณ
--cache-to=CACHE
: Cache export destinations (eg. user/app:cache, type=local,dest=path/to/dir) (compatible withdocker buildx build
) - ๐ณ
--platform=(amd64|arm64|...)
: Set target platform for build (compatible withdocker buildx build
) - ๐ณ
--iidfile=FILE
: Write the image ID to the file - ๐ค
--ipfs
: Build image with pulling base images from IPFS. See./docs/ipfs.md
for details. - ๐ณ
--label
: Set metadata for an image
Unimplemented docker build
flags: --add-host
, --network
, --squash
Create a new image from a container's changes
Usage: nerdctl commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
Flags:
- ๐ณ
-a, --author
: Author (e.g., "nerdctl contributor [email protected]") - ๐ณ
-m, --message
: Commit message - ๐ณ
-c, --change
: Apply Dockerfile instruction to the created image (supported directives: [CMD, ENTRYPOINT]) - ๐ณ
-p, --pause
: Pause container during commit (default: true)
List images
Usage: nerdctl images [OPTIONS] [REPOSITORY[:TAG]]
Flags:
- ๐ณ
-a, --all
: Show all images (unimplemented) - ๐ณ
-q, --quiet
: Only show numeric IDs - ๐ณ
--no-trunc
: Don't truncate output - ๐ณ
--format
: Format the output using the given Go template- ๐ณ
--format=table
(default): Table - ๐ณ
--format='{{json .}}'
: JSON - ๐ค
--format=wide
: Wide table - ๐ค
--format=json
: Alias of--format='{{json .}}'
- ๐ณ
- ๐ณ
--digests
: Show digests (compatible with Docker, unlike ID) - ๐ค
--names
: Show image names
Unimplemented docker images
flags: --filter
Pull an image from a registry.
Usage: nerdctl pull [OPTIONS] NAME[:TAG|@DIGEST]
๐ค ipfs://
prefix can be used for NAME
to pull it from IPFS. See /docs/ipfs.md
for details.
Flags:
- ๐ณ
--platform=(amd64|arm64|...)
: Pull content for a specific platform- ๐ค Unlike Docker, this flag can be specified multiple times (
--platform=amd64 --platform=arm64
)
- ๐ค Unlike Docker, this flag can be specified multiple times (
- ๐ค
--all-platforms
: Pull content for all platforms - ๐ค
--unpack
: Unpack the image for the current single platform (auto/true/false) - ๐ณ
-q, --quiet
: Suppress verbose output - ๐ค
--verify
: Verify the image (none|cosign). Seedocs/cosign.md
for details. - ๐ค
--cosign-key
: Path to the public key file, KMS, URI or Kubernetes Secret for--verify=cosign
Unimplemented docker pull
flags: --all-tags
, --disable-content-trust
(default true)
Push an image to a registry.
Usage: nerdctl push [OPTIONS] NAME[:TAG]
๐ค ipfs://
prefix can be used for NAME
to push it to IPFS. See /docs/ipfs.md
for details.
Flags:
- ๐ค
--platform=(amd64|arm64|...)
: Push content for a specific platform - ๐ค
--all-platforms
: Push content for all platforms - ๐ค
--sign
: Sign the image (none|cosign). Seedocs/cosign.md
for details. - ๐ค
--cosign-key
: Path to the private key file, KMS, URI or Kubernetes Secret for--sign=cosign
- ๐ค
--allow-nondistributable-artifacts
: Allow pushing images with non-distributable blobs - ๐ค
--ipfs-address
: Multiaddr of IPFS API (default uses$IPFS_PATH
env variable if defined or local directory~/.ipfs
)
Unimplemented docker push
flags: --all-tags
, --disable-content-trust
(default true), --quiet
Load an image from a tar archive or STDIN.
๐ค Supports both Docker Image Spec v1.2 and OCI Image Spec v1.0.
Usage: nerdctl load [OPTIONS]
Flags:
- ๐ณ
-i, --input
: Read from tar archive file, instead of STDIN - ๐ค
--platform=(amd64|arm64|...)
: Import content for a specific platform - ๐ค
--all-platforms
: Import content for all platforms
Unimplemented docker load
flags: --quiet
Save one or more images to a tar archive (streamed to STDOUT by default)
๐ค The archive implements both Docker Image Spec v1.2 and OCI Image Spec v1.0.
Usage: nerdctl save [OPTIONS] IMAGE [IMAGE...]
Flags:
- ๐ณ
-o, --output
: Write to a file, instead of STDOUT - ๐ค
--platform=(amd64|arm64|...)
: Export content for a specific platform - ๐ค
--all-platforms
: Export content for all platforms
Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE.
Usage: nerdctl tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
Remove one or more images
Usage: nerdctl rmi [OPTIONS] IMAGE [IMAGE...]
Flags:
- ๐ค
--async
: Asynchronous mode - ๐ณ
-f, --force
: Ignore removal errorsโ ๏ธ WIP: currently, images are always forcibly removed, even when--force
is not specified.
Unimplemented docker rmi
flags: --no-prune
Display detailed information on one or more images.
Usage: nerdctl image inspect [OPTIONS] NAME|ID [NAME|ID...]
Flags:
- ๐ค
--mode=(dockercompat|native)
: Inspection mode. "native" produces more information. - ๐ณ
--format
: Format the output using the given Go template, e.g,{{json .}}
- ๐ค
--platform=(amd64|arm64|...)
: Inspect a specific platform
Show the history of an image.
Usage: nerdctl history [OPTIONS] IMAGE
Flags:
- ๐ณ
--no-trunc
: Don't truncate output - ๐ณ
-q, --quiet
: Only display snapshots IDs - ๐ณ
--format
: Format the output using the given Go template, e.g,{{json .}}
Convert an image format.
e.g., nerdctl image convert --estargz --oci example.com/foo:orig example.com/foo:esgz
Usage: nerdctl image convert [OPTIONS] SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
Flags:
--estargz
: convert legacy tar(.gz) layers to eStargz for lazy pulling. Should be used in conjunction with '--oci'--estargz-record-in=<FILE>
: readctr-remote optimize --record-out=<FILE>
record file.โ ๏ธ This flag is experimental and subject to change.--estargz-compression-level=<LEVEL>
: eStargz compression level (default: 9)--estargz-chunk-size=<SIZE>
: eStargz chunk size--zstdchunked
: Use zstd compression instead of gzip (a.k.a zstd:chunked). Should be used in conjunction with '--oci'--uncompress
: convert tar.gz layers to uncompressed tar layers--oci
: convert Docker media types to OCI media types--platform=<PLATFORM>
: convert content for a specific platform--all-platforms
: convert content for all platforms (default: false)
Encrypt image layers. See ./docs/ocicrypt.md
.
Usage: nerdctl image encrypt [OPTIONS] SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
Example:
openssl genrsa -out mykey.pem
openssl rsa -in mykey.pem -pubout -out mypubkey.pem
nerdctl image encrypt --recipient=jwe:mypubkey.pem --platform=linux/amd64,linux/arm64 foo example.com/foo:encrypted
nerdctl push example.com/foo:encrypted
Env
and Cmd
.
To see non-encrypted information, run nerdctl image inspect --mode=native --platform=PLATFORM example.com/foo:encrypted
.
Flags:
--recipient=<RECIPIENT>
: Recipient of the image is the person who can decrypt (e.g.,jwe:mypubkey.pem
)--dec-recipient=<RECIPIENT>
: Recipient of the image; used only for PKCS7 and must be an x509 certificate--key=<KEY>[:<PWDDESC>]
: A secret key's filename and an optional password separated by colon, PWDDESC=|pass:|fd=|filename--gpg-homedir=<DIR>
: The GPG homedir to use; by default gpg uses ~/.gnupg--gpg-version=<VERSION>
: The GPG version ("v1" or "v2"), default will make an educated guess--platform=<PLATFORM>
: Convert content for a specific platform--all-platforms
: Convert content for all platforms (default: false)
Decrypt image layers. See ./docs/ocicrypt.md
.
Usage: nerdctl image decrypt [OPTIONS] SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
Example:
nerdctl pull --unpack=false example.com/foo:encrypted
nerdctl image decrypt --key=mykey.pem example.com/foo:encrypted foo:decrypted
Flags:
--dec-recipient=<RECIPIENT>
: Recipient of the image; used only for PKCS7 and must be an x509 certificate--key=<KEY>[:<PWDDESC>]
: A secret key's filename and an optional password separated by colon, PWDDESC=|pass:|fd=|filename--gpg-homedir=<DIR>
: The GPG homedir to use; by default gpg uses ~/.gnupg--gpg-version=<VERSION>
: The GPG version ("v1" or "v2"), default will make an educated guess--platform=<PLATFORM>
: Convert content for a specific platform--all-platforms
: Convert content for all platforms (default: false)
Log in to a Docker registry.
Usage: nerdctl login [OPTIONS] [SERVER]
Flags:
- ๐ณ
-u, --username
: Username - ๐ณ
-p, --password
: Password - ๐ณ
--password-stdin
: Take the password from stdin
Log out from a Docker registry
Usage: nerdctl logout [SERVER]
Create a network
โน๏ธ To isolate CNI bridge, CNI isolation plugin needs to be installed.
Usage: nerdctl network create [OPTIONS] NETWORK
Flags:
- ๐ณ
-d, --driver=(bridge|nat|macvlan|ipvlan)
: Driver to manage the Network- ๐ณ
--driver=bridge
: Default driver for unix - ๐ณ
--driver=macvlan
: Macvlan network driver for unix - ๐ณ
--driver=ipvlan
: IPvlan network driver for unix - ๐ณ ๐ฆ
--driver=nat
: Default driver for windows
- ๐ณ
- ๐ณ
-o, --opt
: Set driver specific options- ๐ณ
--opt=com.docker.network.driver.mtu=<MTU>
: Set the containers network MTU - ๐ค
--opt=mtu=<MTU>
: Alias of--opt=com.docker.network.driver.mtu=<MTU>
- ๐ณ
--opt=macvlan_mode=(bridge)>
: Set macvlan network mode (default: bridge) - ๐ณ
--opt=ipvlan_mode=(l2|l3)
: Set IPvlan network mode (default: l2) - ๐ค
--opt=mode=(bridge|l2|l3)
: Alias of--opt=macvlan_mode=(bridge)
and--opt=ipvlan_mode=(l2|l3)
- ๐ณ
--opt=parent=<INTERFACE>
: Set valid parent interface on host
- ๐ณ
- ๐ณ
--ipam-driver=(default|host-local|dhcp)
: IP Address Management Driver- ๐ณ ๐ฆ
--ipam-driver=default
: Default IPAM driver - ๐ค
--ipam-driver=host-local
: Host-local IPAM driver for unix - ๐ค
--ipam-driver=dhcp
: DHCP IPAM driver for unix, requires root
- ๐ณ ๐ฆ
- ๐ณ
--ipam-opt
: Set IPAM driver specific options - ๐ณ
--subnet
: Subnet in CIDR format that represents a network segment, e.g. "10.5.0.0/16" - ๐ณ
--gateway
: Gateway for the master subnet - ๐ณ
--ip-range
: Allocate container ip from a sub-range - ๐ณ
--label
: Set metadata on a network
Unimplemented docker network create
flags: --attachable
, --aux-address
, --config-from
, --config-only
, --ingress
, --internal
, --ipv6
, --scope
List networks
Usage: nerdctl network ls [OPTIONS]
Flags:
- ๐ณ
-q, --quiet
: Only display network IDs - ๐ณ
--format
: Format the output using the given Go template- ๐ณ
--format=table
(default): Table - ๐ณ
--format='{{json .}}'
: JSON - ๐ค
--format=wide
: Alias of--format=table
- ๐ค
--format=json
: Alias of--format='{{json .}}'
- ๐ณ
Unimplemented docker network ls
flags: --filter
, --no-trunc
Display detailed information on one or more networks
Usage: nerdctl network inspect [OPTIONS] NETWORK [NETWORK...]
Flags:
- ๐ณ
--format
: Format the output using the given Go template, e.g,{{json .}}
Unimplemented docker network inspect
flags: --verbose
Remove one or more networks
Usage: nerdctl network rm NETWORK [NETWORK...]
Create a volume
Usage: nerdctl volume create [OPTIONS] [VOLUME]
Flags:
- ๐ณ
--label
: Set metadata for a volume
Unimplemented docker volume create
flags: --driver
, --opt
List volumes
Usage: nerdctl volume ls [OPTIONS]
Flags:
- ๐ณ
-q, --quiet
: Only display volume names - ๐ณ
--format
: Format the output using the given Go template- ๐ณ
--format=table
(default): Table - ๐ณ
--format='{{json .}}'
: JSON - ๐ค
--format=wide
: Alias of--format=table
- ๐ค
--format=json
: Alias of--format='{{json .}}'
- ๐ณ
Unimplemented docker volume ls
flags: --filter
Display detailed information on one or more volumes
Usage: nerdctl volume inspect [OPTIONS] VOLUME [VOLUME...]
Flags:
- ๐ณ
--format
: Format the output using the given Go template, e.g,{{json .}}
Remove one or more volumes
Usage: nerdctl volume rm [OPTIONS] VOLUME [VOLUME...]
- ๐ณ
-f, --force
: Force the removal of one or more volumesโ ๏ธ WIP: currently, volumes are always forcibly removed, even when--force
is not specified.
Create a new namespace.
Usage: nerdctl namespace create NAMESPACE
Flags:
--label
: Set labels for a namespace
Inspect a namespace.
Usage: nerdctl namespace inspect NAMESPACE
List containerd namespaces such as "default", "moby", or "k8s.io".
Usage: nerdctl namespace ls [OPTIONS]
Flags:
-q, --quiet
: Only display namespace names
Remove one or more namespaces.
Usage: nerdctl namespace remove [OPTIONS] NAMESPACE [NAMESPACE...]
Flags:
-c, --cgroup
: delete the namespace's cgroup
Udapte labels for a namespace.
Usage: nerdctl namespace update NAMESPACE
Flags:
--label
: Set labels for a namespace
Display the default AppArmor profile "nerdctl-default". Other profiles cannot be displayed with this command.
Usage: nerdctl apparmor inspect
Load the default AppArmor profile "nerdctl-default". Requires root.
Usage: nerdctl apparmor load
List the loaded AppArmor profile
Usage: nerdctl apparmor ls [OPTIONS]
Flags:
-q, --quiet
: Only display volume names--format
: Format the output using the given Go template, e.g,{{json .}}
Unload an AppArmor profile. The target profile name defaults to "nerdctl-default". Requires root.
Usage: nerdctl apparmor unload [PROFILE]
Clean up BuildKit build cache.
Usage: nerdctl builder prune
Flags:
- ๐ค
--buildkit-host=<BUILDKIT_HOST>
: BuildKit address
Interactive debugging of Dockerfile using buildg.
Please refer to ./docs/builder-debug.md
for details.
This is an experimental feature.
buildkitd
daemon but uses the patched version of BuildKit provided by buildg. This should be fixed in the future.
Usage: nerdctl builder debug PATH
Flags:
- ๐ค
-f
,--file
: Name of the Dockerfile - ๐ค
--image
: Image to use for debugging stage - ๐ค
--target
: Set the target build stage to build - ๐ค
--build-arg
: Set build-time variables
Unimplemented docker builder prune
flags: --all
, --filter
, --force
, --keep-storage
Get real time events from the server.
Usage: nerdctl events [OPTIONS]
Flags:
- ๐ณ
--format
: Format the output using the given Go template, e.g,{{json .}}
Unimplemented docker events
flags: --filter
, --since
, --until
Display system-wide information
Usage: nerdctl info [OPTIONS]
Flags:
- ๐ณ
-f, --format
: Format the output using the given Go template, e.g,{{json .}}
- ๐ค
--mode=(dockercompat|native)
: Information mode. "native" produces more information.
Show the nerdctl version information
Usage: nerdctl version [OPTIONS]
Flags:
- ๐ณ
-f, --format
: Format the output using the given Go template, e.g,{{json .}}
Display a live stream of container(s) resource usage statistics.
Usage: nerdctl stats [OPTIONS]
Flags:
- ๐ณ
-a, --all
: Show all containers (default shows just running) - ๐ณ
--format=FORMAT
: Pretty-print images using a Go template, e.g.,{{json .}}
- ๐ณ
--no-stream
: Disable streaming stats and only pull the first result - ๐ณ
--no-trunc
: Do not truncate output
Display the running processes of a container.
Usage: nerdctl top CONTAINER [ps OPTIONS]
Generate the autocompletion script for bash.
Usage: add the following line to ~/.bash_profile
:
source <(nerdctl completion bash)
Or run nerdctl completion bash > /etc/bash_completion.d/nerdctl
as the root.
Generate the autocompletion script for zsh.
Usage: see nerdctl completion zsh --help
Generate the autocompletion script for fish.
Usage: see nerdctl completion fish --help
Generate the autocompletion script for powershell.
Usage: see nerdctl completion powershell --help
Compose
Usage: nerdctl compose [OPTIONS] [COMMAND]
Flags:
- ๐ณ
-f, --file
: Specify an alternate compose file - ๐ณ
-p, --project-name
: Specify an alternate project name
Create and start containers
Usage: nerdctl compose up [OPTIONS] [SERVICE...]
Flags:
- ๐ณ
-d, --detach
: Detached mode: Run containers in the background - ๐ณ
--no-build
: Don't build an image, even if it's missing. - ๐ณ
--no-color
: Produce monochrome output - ๐ณ
--no-log-prefix
: Don't print prefix in logs - ๐ณ
--build
: Build images before starting containers. - ๐ค
--ipfs
: Build images with pulling base images from IPFS. See./docs/ipfs.md
for details. - ๐ณ
--quiet-pull
: Pull without printing progress information - ๐ณ
--scale
: Scale SERVICE to NUM instances. Overrides thescale
setting in the Compose file if present. - ๐ณ
--remove-orphans
: Remove containers for services not defined in the Compose file
Unimplemented docker-compose up
(V1) flags: --no-deps
, --force-recreate
, --always-recreate-deps
, --no-recreate
,
--no-start
, --abort-on-container-exit
, --attach-dependencies
, --timeout
, --renew-anon-volumes
, --exit-code-from
Unimplemented docker compose up
(V2) flags: --environment
Create and start containers
Usage: nerdctl compose logs [OPTIONS]
Flags:
- ๐ณ
--no-color
: Produce monochrome output - ๐ณ
--no-log-prefix
: Don't print prefix in logs - ๐ณ
--timestamps
: Show timestamps - ๐ณ
--tail
: Number of lines to show from the end of the logs
Unimplemented docker compose logs
(V2) flags: --since
, --until
Build or rebuild services.
Usage: nerdctl compose build [OPTIONS]
Flags:
- ๐ณ
--build-arg
: Set build-time variables for services - ๐ณ
--no-cache
: Do not use cache when building the image - ๐ณ
--progress
: Set type of progress output (auto, plain, tty) - ๐ค
--ipfs
: Build images with pulling base images from IPFS. See./docs/ipfs.md
for details.
Unimplemented docker-compose build
(V1) flags: --compress
, --force-rm
, --memory
, --no-rm
, --parallel
, --pull
, --quiet
Remove containers and associated resources
Usage: nerdctl compose down [OPTIONS]
Flags:
- ๐ณ
-v, --volumes
: Remove named volumes declared in the volumes section of the Compose file and anonymous volumes attached to containers
Unimplemented docker-compose down
(V1) flags: --rmi
, --remove-orphans
, --timeout
List containers of services
Usage: nerdctl compose ps
Unimplemented docker-compose ps
(V1) flags: --quiet
, --services
, --filter
, --all
Unimplemented docker compose ps
(V2) flags: --format
, --status
Pull service images
Usage: nerdctl compose pull
Flags:
- ๐ณ
-q, --quiet
: Pull without printing progress information
Unimplemented docker-compose pull
(V1) flags: --ignore-pull-failures
, --parallel
, --no-parallel
, include-deps
Push service images
Usage: nerdctl compose push
Unimplemented docker-compose pull
(V1) flags: --ignore-push-failures
Validate and view the Compose file
Usage: nerdctl compose config
Flags:
- ๐ณ
-q, --quiet
: Pull without printing progress information - ๐ณ
--services
: Print the service names, one per line. - ๐ณ
--volumes
: Print the volume names, one per line. - ๐ณ
--hash="*"
: Print the service config hash, one per line.
Unimplemented docker-compose config
(V1) flags: --resolve-image-digests
, --no-interpolate
Unimplemented docker compose config
(V2) flags: --resolve-image-digests
, --no-interpolate
, --format
, --output
, --profiles
Force stop service containers
Usage: nerdctl compose kill
Flags:
- ๐ณ
-s, --signal
: SIGNAL to send to the container (default: "SIGKILL")
P2P image distribution (IPFS) is completely optional. Your host is NOT connected to any P2P network, unless you opt in to install and run IPFS daemon.
Start read-only local registry backed by IPFS.
See ./docs/ipfs.md
for details.
Usage: nerdctl ipfs registry up [OPTIONS]
Flags:
- ๐ค
--listen-registry
: Address to listen (defaultlocalhost:5050
) - ๐ค
--read-retry-num
: Times to retry query on IPFS (default 0 (no retry)) - ๐ค
--read-timeout
: Timeout duration of a read request to IPFS (default 0 (no timeout))
Stop and remove read-only local registry backed by IPFS.
See ./docs/ipfs.md
for details.
Usage: nerdctl ipfs registry down
Serve read-only registry backed by IPFS on localhost.
Use nerdctl ipfs registry up
.
Usage: nerdctl ipfs registry serve [OPTIONS]
Flags:
- ๐ค
--ipfs-address
: Multiaddr of IPFS API (default is pulled from$IPFS_PATH/api
file. If$IPFS_PATH
env var is not present, it defaults to~/.ipfs
). - ๐ค
--listen-registry
: Address to listen (defaultlocalhost:5050
). - ๐ค
--read-retry-num
: Times to retry query on IPFS (default 0 (no retry)) - ๐ค
--read-timeout
: Timeout duration of a read request to IPFS (default 0 (no timeout))
- ๐ค ๐ฆ
--address
: containerd address, optionally with "unix://" prefix - ๐ค ๐ฆ
-a
,--host
,-H
: deprecated aliases of--address
- ๐ค ๐ฆ
--namespace
: containerd namespace - ๐ค ๐ฆ
-n
: deprecated alias of--namespace
- ๐ค ๐ฆ
--snapshotter
: containerd snapshotter - ๐ค ๐ฆ
--storage-driver
: deprecated alias of--snapshotter
- ๐ค ๐ฆ
--cni-path
: CNI binary path (default:/opt/cni/bin
) [$CNI_PATH
] - ๐ค ๐ฆ
--cni-netconfpath
: CNI netconf path (default:/etc/cni/net.d
) [$NETCONFPATH
] - ๐ค ๐ฆ
--data-root
: nerdctl data root, e.g. "/var/lib/nerdctl" - ๐ค
--cgroup-manager=(cgroupfs|systemd|none)
: cgroup manager- Default: "systemd" on cgroup v2 (rootful & rootless), "cgroupfs" on v1 rootful, "none" on v1 rootless
- ๐ค
--insecure-registry
: skips verifying HTTPS certs, and allows falling back to plain HTTP
The global flags can be also specified in /etc/nerdctl/nerdctl.toml
(rootful) and ~/.config/nerdctl/nerdctl.toml
(rootless).
See ./docs/config.md
.
Container management:
-
docker attach
-
docker diff
-
docker container prune
-
docker checkpoint *
Image:
-
docker export
anddocker import
-
docker image prune
-
docker trust *
(Instead, nerdctl supportsnerdctl pull --verify=cosign
andnerdctl push --sign=cosign
. See./docs/cosign.md
.) -
docker manifest *
Network management:
docker network connect
docker network disconnect
docker network prune
Registry:
docker search
Compose:
docker-compose create|events|exec|images|pause|port|restart|rm|run|scale|start|stop|top|unpause
Others:
docker system df
docker system prune
docker context
- Swarm commands are unimplemented and will not be implemented:
docker swarm|node|service|config|secret|stack *
- Plugin commands are unimplemented and will not be implemented:
docker plugin *
Configuration guide:
./docs/config.md
: Configuration (/etc/nerdctl/nerdctl.toml
,~/.config/nerdctl/nerdctl.toml
)./docs/registry.md
: Registry authentication (~/.docker/config.json
)
Basic features:
./docs/compose.md
: Compose./docs/rootless.md
: Rootless mode./docs/cni.md
: CNI for containers network./docs/build.md
:nerdctl build
with BuildKit
Advanced features:
./docs/stargz.md
: Lazy-pulling using Stargz Snapshotter./docs/ocicrypt.md
: Running encrypted images./docs/gpu.md
: Using GPUs inside containers./docs/multi-platform.md
: Multi-platform mode
Experimental features:
./docs/experimental.md
: Experimental features./docs/freebsd.md
: Running FreeBSD jails./docs/ipfs.md
: Distributing images on IPFS./docs/builder-debug.md
: Interactive debugging of Dockerfile
Implementation details:
./docs/dir.md
: Directory layout (/var/lib/nerdctl
)
Misc:
./docs/faq.md
: FAQs and Troubleshooting