contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...

[ ⬇️ Download] [ πŸ“– Command reference] [ πŸ“š Additional documents]

nerdctl: Docker-compatible CLI for containerd

nerdctl is a Docker-compatible CLI for containerd.

βœ… Same UI/UX as docker

βœ… Supports Docker Compose (nerdctl compose up)

βœ… Supports rootless mode

βœ… Supports lazy-pulling (Stargz)

βœ… Supports encrypted images (ocicrypt)

βœ… Supports P2P image distribution (IPFS)

nerdctl is a non-core sub-project of containerd.

Examples

Basic usage

To run a container with the default 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.

Debugging Kubernetes

To list Kubernetes containers:

# nerdctl --namespace k8s.io ps -a

Rootless mode

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.

Install

Binaries are available here: https://github.com/containerd/nerdctl/releases

In addition to containerd, the following components should be installed (optional):

  • CNI plugins: for using nerdctl run.
  • CNI isolation plugin: for isolating bridge networks (nerdctl network create)
  • BuildKit: for using nerdctl build. BuildKit daemon (buildkitd) needs to be running.
  • RootlessKit and slirp4netns: 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- - - .tar.gz , but not included in nerdctl- - - .tar.gz .

macOS

Lima project provides Linux virtual machines 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

FreeBSD

See ./docs/freebsd.md.

Windows

  • Linux containers: Known to work on WSL2
  • Windows containers: experimental support for Windows (see below for features that are currently known to work)

Docker

To run containerd and nerdctl inside Docker:

docker build -t nerdctl .
docker run -it --rm --privileged nerdctl

Motivation

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.

Features present in nerdctl but not present in Docker

Major:

Minor:

  • Namespacing: nerdctl --namespace= ps . (NOTE: All Kubernetes containers are in the k8s.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 /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= . Use sudo nerdctl apparmor load to load the nerdctl-default profile.

Trivial:

  • Inspecting raw OCI config: nerdctl container inspect --mode=native .

Similar tools

  • ctr: incompatible with Docker CLI, and not friendly to users. Notably, ctr lacks the equivalents of the following Docker CLI commands:

    • docker run -p
    • docker run --restart=always --net=bridge
    • docker pull with ~/.docker/config.json and credential helper binaries such as docker-credential-ecr-login
    • docker logs
  • 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 and kim push

  • PouchContainer (abandoned?): needs an extra daemon

Developer guide

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.

Compiling nerdctl from source

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

Test suite

Running unit tests

Run go test -v ./pkg/...

Running integration test suite against nerdctl

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

Running integration test suite against Docker

Run go test -exec sudo -v ./cmd/nerdctl/... -args test.target=docker to ensure that the test suite is compatible with Docker.

Contributing to nerdctl

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.


Command reference

🐳 = 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.

Run & Exec

🐳 🟦 nerdctl run

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 IFPS. 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 requires -i, and conflicts with -d
  • 🐳 🟦 -d, --detach: Run container in background and print container ID
  • 🐳 --restart=(no|always): Restart policy to apply when a container exits
    • Default: "no"
    • ⚠️ No support for on-failure and unless-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

Platform flags:

  • 🐳 --platform=(amd64|arm64|...): Set platform

Network flags:

  • 🐳 --net, --network=(bridge|host|none| ) : 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
  • 🐳 -h, --hostname: Container host name
  • 🐳 --add-host: Add a custom host-to-IP mapping (host:ip)

Cgroup flags:

  • 🐳 --cpus: Number of CPUs
  • 🐳 --cpu-shares: CPU shares (relative weight)
  • 🐳 --cpuset-cpus: CPUs in which to allow execution (0-3, 0,1)
  • 🐳 --memory: Memory limit
  • 🐳 --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

User flags:

  • 🐳 🟦 -u, --user: Username or UID (format: [: ])

Security flags:

  • 🐳 --security-opt seccomp= : specify custom seccomp profile
  • 🐳 --security-opt apparmor= : specify custom AppArmor profile
  • 🐳 --security-opt no-new-privileges: disallow privilege escalation, e.g., setuid and file capabilities
  • 🐳 --cap-add= : Add Linux capabilities
  • 🐳 --cap-drop= : 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 : [: ] : 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 with rprivate. 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 as ro.
    • 🐳 option shared, slave, private: Non-recursive "shared" / "slave" / "private" propagation
    • 🐳 option rshared, rslave, rprivate: Recursive "shared" / "slave" / "private" propagation
  • 🐳 --tmpfs: Mount a tmpfs directory

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.

Shared memory flags:

  • 🐳 --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

Other docker run flags are on plan but unimplemented yet.

Clicke here to show all the `docker run` flags (Docker 20.10)

[: ]) --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 ">
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: 
     
      [:
      
       ])
      --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

      
     

🐳 🟦 nerdctl exec

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 requires -i, and 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

Unimplemented docker exec flags: --detach-keys, --user

Container management

🐳 🟦 nerdctl ps

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 .}}'

Unimplemented docker ps flags: --filter, --last, --size

🐳 🟦 nerdctl inspect

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 .}}

Unimplemented docker inspect flags: --size, --type

🐳 nerdctl logs

Fetch the logs of a container.

⚠️ Currently, only containers created with 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

🐳 nerdctl port

List port mappings or a specific mapping for the container.

Usage: nerdctl port CONTAINER [PRIVATE_PORT[/PROTO]]

🐳 nerdctl rm

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

🐳 nerdctl stop

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")

🐳 nerdctl start

Start one or more running containers.

Usage: nerdctl start [OPTIONS] CONTAINER [CONTAINER...]

Unimplemented docker start flags: --attach, --checkpoint, --checkpoint-dir, --detach-keys, --interactive

🐳 nerdctl restart

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")

🐳 nerdctl wait

Block until one or more containers stop, then print their exit codes.

Usage: nerdctl wait CONTAINER [CONTAINER...]

🐳 nerdctl kill

Kill one or more running containers.

Usage: nerdctl kill [OPTIONS] CONTAINER [CONTAINER...]

Flags:

  • 🐳 -s, --signal: Signal to send to the container (default: "KILL")

🐳 nerdctl pause

Pause all processes within one or more containers.

Usage: nerdctl pause CONTAINER [CONTAINER...]

🐳 nerdctl unpause

Unpause all processes within one or more containers.

Usage: nerdctl unpause CONTAINER [CONTAINER...]

Build

🐳 nerdctl build

Build an image from a Dockerfile.

ℹ️ Needs buildkitd to be running.

Usage: nerdctl build [OPTIONS] PATH

Flags:

  • πŸ€“ --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 with docker buildx build)
    • 🐳 type=docker[,dest=path/to/output.tar]: Docker format tar ball (compatible with docker buildx build)
    • 🐳 type=tar[,dest=path/to/output.tar]: Raw tar ball
    • 🐳 type=image,name=example.com/image,push=true: Push to a registry (see buildctl 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| [= | [, ]] )
  • 🐳 -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 with docker buildx build)
  • 🐳 --cache-to=CACHE: Cache export destinations (eg. user/app:cache, type=local,dest=path/to/dir) (compatible with docker buildx build)
  • 🐳 --platform=(amd64|arm64|...): Set target platform for build (compatible with docker buildx build)
  • πŸ€“ --ipfs: Build image with pulling base images from IFPS. See ./docs/ipfs.md for details.

Unimplemented docker build flags: --add-host, --iidfile, --label, --network, --squash

🐳 nerdctl commit

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

Unimplemented docker commit flags: --change, --pause

Image management

🐳 🟦 nerdctl images

List images

⚠️ The image ID is usually different from Docker image ID.

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)

Unimplemented docker images flags: --filter

🐳 🟦 nerdctl pull

Pull an image from a registry.

Usage: nerdctl pull [OPTIONS] NAME[:TAG|@DIGEST]

πŸ€“ ipfs:// prefix can be used for NAME to pull it from IFPS. 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)
  • πŸ€“ --all-platforms: Pull content for all platforms
  • πŸ€“ --unpack: Unpack the image for the current single platform (auto/true/false)

Unimplemented docker pull flags: --all-tags, --disable-content-trust (default true), --quiet

🐳 nerdctl push

Push an image to a registry.

Usage: nerdctl push [OPTIONS] NAME[:TAG]

πŸ€“ ipfs:// prefix can be used for NAME to push it to IFPS. See /docs/ipfs.md for details.

Flags:

  • πŸ€“ --platform=(amd64|arm64|...): Push content for a specific platform
  • πŸ€“ --all-platforms: Push content for all platforms

Unimplemented docker push flags: --all-tags, --disable-content-trust (default true), --quiet

🐳 nerdctl load

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

🐳 nerdctl save

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

🐳 nerdctl tag

Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE.

Usage: nerdctl tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

🐳 nerdctl rmi

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

🐳 nerdctl image inspect

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

πŸ€“ nerdctl image convert

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= : read ctr-remote optimize --record-out= record file. ⚠️ This flag is experimental and subject to change.
  • --estargz-compression-level= : eStargz compression level (default: 9)
  • --estargz-chunk-size= : eStargz chunk size
  • --uncompress : convert tar.gz layers to uncompressed tar layers
  • --oci : convert Docker media types to OCI media types
  • --platform= : convert content for a specific platform
  • --all-platforms : convert content for all platforms (default: false)

πŸ€“ nerdctl image encrypt

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

⚠️ CAUTION: This command only encrypts image layers, but does NOT encrypt container configuration such as Env and Cmd. To see non-encrypted information, run nerdctl image inspect --mode=native --platform=PLATFORM example.com/foo:encrypted .

Flags:

  • --recipient= : Recipient of the image is the person who can decrypt (e.g., jwe:mypubkey.pem)
  • --dec-recipient= : Recipient of the image; used only for PKCS7 and must be an x509 certificate
  • --key= [: ] : A secret key's filename and an optional password separated by colon, PWDDESC=|pass:|fd=|filename
  • --gpg-homedir= : The GPG homedir to use; by default gpg uses ~/.gnupg
  • --gpg-version= : The GPG version ("v1" or "v2"), default will make an educated guess
  • --platform= : Convert content for a specific platform
  • --all-platforms : Convert content for all platforms (default: false)

πŸ€“ nerdctl image decrypt

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 of the image; used only for PKCS7 and must be an x509 certificate
  • --key= [: ] : A secret key's filename and an optional password separated by colon, PWDDESC=|pass:|fd=|filename
  • --gpg-homedir= : The GPG homedir to use; by default gpg uses ~/.gnupg
  • --gpg-version= : The GPG version ("v1" or "v2"), default will make an educated guess
  • --platform= : Convert content for a specific platform
  • --all-platforms : Convert content for all platforms (default: false)

Registry

🐳 nerdctl login

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

🐳 nerdctl logout

Log out from a Docker registry

Usage: nerdctl logout [SERVER]

Network management

🐳 nerdctl network create

Create a network

ℹ️ To isolate CNI bridge, CNI isolation plugin needs to be installed.

Usage: nerdctl network create [OPTIONS] NETWORK

Flags:

  • 🐳 --subnet: Subnet in CIDR format that represents a network segment, e.g. "10.5.0.0/16"
  • 🐳 --label: Set metadata on a network

Unimplemented docker network create flags: --attachable, --aux-address, --config-from, --config-only, --driver, --gateway, --ingress, --internal, --ip-range, --ipam-driver, --ipam-opt, --ipv6, --opt, --scope

🐳 nerdctl network ls

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

🐳 nerdctl network inspect

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

🐳 nerdctl network rm

Remove one or more networks

Usage: nerdctl network rm NETWORK [NETWORK...]

Volume management

🐳 nerdctl volume create

Create a volume

Usage: nerdctl volume create [OPTIONS] [VOLUME]

Flags:

  • 🐳 --label: Set metadata for a volume

Unimplemented docker volume create flags: --driver, --opt

🐳 nerdctl volume ls

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

🐳 nerdctl volume inspect

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 .}}

🐳 nerdctl volume rm

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.

Namespace management

πŸ€“ 🟦 nerdctl namespace ls

List containerd namespaces such as "default", "moby", or "k8s.io".

Usage: nerdctl namespace ls [OPTIONS]

Flags:

  • -q, --quiet: Only display namespace names

AppArmor profile management

πŸ€“ nerdctl apparmor inspect

Display the default AppArmor profile "nerdctl-default". Other profiles cannot be displayed with this command.

Usage: nerdctl apparmor inspect

πŸ€“ nerdctl apparmor load

Load the default AppArmor profile "nerdctl-default". Requires root.

Usage: nerdctl apparmor load

πŸ€“ nerdctl apparmor ls

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 .}}

πŸ€“ nerdctl apparmor unload

Unload an AppArmor profile. The target profile name defaults to "nerdctl-default". Requires root.

Usage: nerdctl apparmor unload [PROFILE]

System

🐳 nerdctl events

Get real time events from the server.

⚠️ The output format is not compatible with Docker.

Usage: nerdctl events [OPTIONS] Flags:

  • 🐳 --format: Format the output using the given Go template, e.g, {{json .}}

Unimplemented docker events flags: --filter, --since, --until

🐳 nerdctl info

Display system-wide information

Usage: nerdctl info [OPTIONS]

Flags:

  • 🐳 -f, --format: Format the output using the given Go template, e.g, {{json .}}

🐳 nerdctl version

Show the nerdctl version information

Usage: nerdctl version [OPTIONS]

Flags:

  • ?? -f, --format: Format the output using the given Go template, e.g, {{json .}}

Stats

🐳 nerdctl stats

Display a live stream of container(s) resource usage statistics.

NOTE: no support for network I/O on cgroup v2 hosts (yet), see issue #516

Usage: nerdctl stats [flags]

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

🐳 nerdctl top

Display the running processes of a container.

Usage: nerdctl top CONTAINER [ps OPTIONS]

Shell completion

πŸ€“ nerdctl completion bash

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.

πŸ€“ nerdctl completion zsh

Generate the autocompletion script for zsh.

Usage: see nerdctl completion zsh --help

πŸ€“ nerdctl completion fish

Generate the autocompletion script for fish.

Usage: see nerdctl completion fish --help

πŸ€“ nerdctl completion powershell

Generate the autocompletion script for powershell.

Usage: see nerdctl completion powershell --help

Compose

🐳 nerdctl compose

Compose

Usage: nerdctl compose [OPTIONS] [COMMAND]

Flags:

  • 🐳 -f, --file: Specify an alternate compose file
  • 🐳 -p, --project-name: Specify an alternate project name

🐳 nerdctl compose up

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 IFPS. See ./docs/ipfs.md for details.

Unimplemented docker-compose up (V1) flags: --quiet-pull, --no-deps, --force-recreate, --always-recreate-deps, --no-recreate, --no-start, --abort-on-container-exit, --attach-dependencies, --timeout, --renew-anon-volumes, --remove-orphans, --exit-code-from, --scale

Unimplemented docker compose up (V2) flags: --environment

🐳 nerdctl compose logs

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 build (V2) flags: --since, --until

🐳 nerdctl compose build

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 IFPS. See ./docs/ipfs.md for details.

Unimplemented docker-compose build (V1) flags: --compress, --force-rm, --memory, --no-rm, --parallel, --pull, --quiet

🐳 nerdctl compose down

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

🐳 nerdctl compose ps

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

🐳 nerdctl compose pull

Pull service images

Usage: nerdctl compose pull

Unimplemented docker-compose pull (V1) flags: --ignore-pull-failures, --parallel, --no-parallel, quiet, include-deps

🐳 nerdctl compose push

Push service images

Usage: nerdctl compose push

Unimplemented docker-compose pull (V1) flags: --ignore-push-failures

IPFS management

πŸ€“ nerdctl ipfs registry up

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 (default localhost:5050)

πŸ€“ nerdctl ipfs registry down

Stop and remove read-only local registry backed by IPFS. See ./docs/ipfs.md for details.

Usage: nerdctl ipfs registry down

πŸ€“ nerdctl ipfs registry serve

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 (default localhost:5050).

Global flags

  • πŸ€“ 🟦 --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

Unimplemented Docker commands

Container management:

  • docker create

  • docker attach

  • docker cp

  • docker diff

  • docker rename

  • docker container prune

  • docker checkpoint *

Image:

  • docker export and docker import

  • docker history

  • docker image prune

  • docker trust *

  • docker manifest *

Network management:

  • docker network connect
  • docker network disconnect
  • docker network prune

Registry:

  • docker search

Compose:

  • docker-compose config|create|events|exec|images|kill|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 *

Additional documents

Configuration guide:

Basic features:

Advanced features:

Experimental features:

Implementation details:

Comments
  • feat: cosign sign

    feat: cosign sign

    Signed-off-by: Batuhan ApaydΔ±n [email protected] Co-authored-by: Furkan TΓΌrkal [email protected]

    Fixes #423

    I forgot that we can't have a digest before pushing the image, so, we have to do it right after pushing the image. πŸ™‹πŸ»β€β™‚οΈ

    ## Keyless Mode
    $ COSIGN_EXPERIMENTAL=1 _output/nerdctl push --sign devopps/bar:latest
    
    ## Without Keyless Mode
    $ cosign generate-key-pair
    $ _output/nerdctl push --sign --cosign-key cosign.key devopps/bar:latest
    
  • Windows Part 2 - run windows containers

    Windows Part 2 - run windows containers

    Continuation of #184 to enable running Windows containers in #28. This add ability to run Windows Containers:

    run a container (with image that is not pulled):

    PS C:\projects\nerdctl> .\_output\nerdctl.exe run -d mcr.microsoft.com/oss/kubernetes/pause:3.4.1
    mcr.microsoft.com/oss/kubernetes/pause:3.4.1:                                     resolved       |++++++++++++++++++++++++++++++++++++++|
    index-sha256:e3b8c20681593c21b344ad801fbb8abaf564427ee3a57a9fcfa3b455f917ce46:    done           |++++++++++++++++++++++++++++++++++++++|
    manifest-sha256:60b0987a9a89932a59a30f4d896ba061a612b23444cadb34827802298cb9db31: done           |++++++++++++++++++++++++++++++++++++++|
    config-sha256:3914de10243c46fdec6e1f4583301185a0b1ead4d6c8964f46984b130674bf14:   done           |++++++++++++++++++++++++++++++++++++++|
    layer-sha256:a17285143420aa470f0b8c1addb73751bd647cf21979c011bf668130c513c4d0:    done           |++++++++++++++++++++++++++++++++++++++|
    layer-sha256:2021f649dd34b8a57b0ea5620d3d32b08fe9c96e7dd2e4d7c357e2e1a30f92d2:    done           |++++++++++++++++++++++++++++++++++++++|
    layer-sha256:1a142ed7c6984745b2f5e82416e73231992fa374e43d3b546d93ff44499e156c:    done           |++++++++++++++++++++++++++++++++++++++|
    elapsed: 3.1 s                                                                    total:  1.4 Mi (461.7 KiB/s)
    6f38e163e20d83a5c2a7f704a78711ec0f33bc826c4ff7489c7353cf90eabf04
    

    interact with it:

    PS C:\projects\nerdctl> .\_output\nerdctl.exe ps
    CONTAINER ID    IMAGE                                           COMMAND         CREATED           STATUS    PORTS    NAMES
    6f38e163e20d    mcr.microsoft.com/oss/kubernetes/pause:3.4.1    "/pause.exe"    15 seconds ago    Up
    PS C:\projects\nerdctl> .\_output\nerdctl.exe exec -it 6f3 cmd /c ver
    
    Microsoft Windows [Version 10.0.19042.746]
                  
    PS C:\projects\nerdctl> .\_output\nerdctl.exe exec -it 6f3 cmd /c dir
     Volume in drive C has no label.
     Volume Serial Number is 26D1-7C1B
    
     Directory of C:\Windows\system32
    
    04/28/2021  09:41 PM    <DIR>          .
    04/28/2021  09:41 PM    <DIR>          ..
    01/09/2021  06:15 AM            15,160 3c7d1890-aab1-46fe-bae1-905efdef4d5f_win3
    2kfull.dll
    12/06/2019  11:42 PM            12,088 69fe178f-26e7-43a9-aa7d-2b616b672dde_even              
  • /dev/shm support is broken (Was: `What options does the --tmpfs flag in the run statement allow`)

    /dev/shm support is broken (Was: `What options does the --tmpfs flag in the run statement allow`)

    I'm trying to a run an Oracle Database in a Docker image in a lima environment on macOS and get a lot of errors related to the shm volume.

    lima nerdctl run --detach --name="oracledb" --network="oraclenet" --memory="4g" --publish="1521:1521" --volume="/dev/shm" --tmpfs="/dev/shm:rw,exec,size=1g" qualiant/database
    

    As there is no specific documentation, I wanted to ask a few specific questions:

    1. Does nerdctl all the options --tmpfs="/dev/shm:rw,exec,size=1g" in the --tmpfs flag ?
    2. nerdctl support the --memory option but how does this relate to lima? Is it guaranteed that the container gets 4g when using the --memory flag independently from lima?

    Thank you!

  • feat: use buildkit API for clean up build cache within `system prune`

    feat: use buildkit API for clean up build cache within `system prune`

    Signed-off-by: Zhou Zhiqiang [email protected]

    This PR does not change the logic of nerdctl builder prune, please let me know if we should also update it.

    prev #1284

    close #1279

  • Use cobra

    Use cobra

    • switch to spf13/cobra
      • support nerdctl build . -t a:b
      • support completion for fish/powershell/zsh
    • run/exec support --
    • add test for exec command
    • add test for envvar CONTAINERD_NAMESPACE support.
      • testutil.go support overrice envvar
    • for image without repository/tag, show <none>, keep compatible with docker.(images command)
    • support logout completion
  • feat: system prune also cleanup build cache

    feat: system prune also cleanup build cache

    Signed-off-by: Zhou Zhiqiang [email protected]

    close https://github.com/containerd/nerdctl/issues/1279

    Changes:

    • call builderPruneAction() within command system prune
  • Add `--cni-bin-dir`/`CNI_BIN_DIR` to override default cni dir (`/opt/cni/bin`)

    Add `--cni-bin-dir`/`CNI_BIN_DIR` to override default cni dir (`/opt/cni/bin`)

    resolves #23

    • [x] ran on my machine :+1:
    • [X] gofmt-ed
    • [X] git commit -s signed off with real name

    I can now successfully use nerdctl run with my cni plugins elsewhere.

    The cli output is now the following, let me know if the wording or order needs changing:

    NAME:
       nerdctl run - Run a command in a new container
    
    USAGE:
       nerdctl run [command options] [arguments...]
    
    OPTIONS:
       --tty, -t                     (Currently -t needs to correspond to -i) (default: false)
       --interactive, -i             (Currently -i needs to correspond to -t) (default: false)
       --detach, -d                  Run container in background and print container ID (default: false)
       --cni-bin-dir value           Set the cni-plugins binary directory (default: "/opt/cni/bin") [$CNI_BIN_DIR]
       --restart value               Restart policy to apply when a container exits (implemented values: "no"|"always") (default: "no")
       --rm                          Automatically remove the container when it exits (default: false)
       --pull value                  Pull image before running ("always"|"missing"|"never") (default: "missing")
       --network value, --net value  Connect a container to a network ("bridge"|"host"|"none") (default: "bridge")
       --dns value                   Set custom DNS servers (only meaningful for "bridge" network) (default: "8.8.8.8", "1.1.1.1")
       --security-opt value          Security options
       --privileged                  Give extended privileges to this container (default: false)
       --help, -h                    show help (default: false)
    
  • v1.0.0: checksum mismatch when running go mod vendor (`nydus-snapshotter@v0.3.0`); main: (`accelerated-container-image@v0.5.2`)

    v1.0.0: checksum mismatch when running go mod vendor (`[email protected]`); main: (`[email protected]`)

    Description

    Working on updating the Buildroot package for nerdctl.

    We run 'go mod vendor' to download the vendor/ tree.

    The following error happens on my build machine:

    verifying github.com/containerd/[email protected]: checksum mismatch
            downloaded: h1:IhG/jkmFKenwAeHNHqLFMfSwNs3pfdH36xd5lpr5PS0=
            go.sum:     h1:15z2Bslu1A7oi++vByV6cTIFzoSjvOGScVCU2y6bRdA=
    
    SECURITY ERROR
    This download does NOT match an earlier download recorded in go.sum.
    The bits may have been replaced on the origin server, or an attacker may
    have intercepted the download attempt.
    
    For more information, see 'go help module-auth'.
    

    I guess the checksum of nydus-snapshotter has changed?

    If so please release a v1.0.1 with updated checksums.

    Steps to reproduce the issue

    1. Run "go mod vendor"

    Describe the results you received and expected

    Expected "go mod vendor" to work correctly.

    What version of nerdctl are you using?

    v1.0.0

    Are you using a variant of nerdctl? (e.g., Rancher Desktop)

    None

    Host information

    No response

  • [tencentyun] Rancher Desktop nerdctl login failed to port 8080 (`Get

    [tencentyun] Rancher Desktop nerdctl login failed to port 8080 (`Get "http://ccr.ccs.tencentyun.com:8080/v2/": EOF`)

    I'm using Rancher Desktop with containrd. I tried to login to my private registry using nerdctl, but it failed:

    $ nerdctl login --debug-full --username=test ccr.ccs.tencentyun.com
    Enter Password:
    DEBU[0001] Ignoring hosts dir "/etc/containerd/certs.d"  error="stat /etc/containerd/certs.d: no such file or directory"
    DEBU[0001] Ignoring hosts dir "/etc/docker/certs.d"      error="stat /etc/docker/certs.d: no such file or directory"
    DEBU[0001] len(regHosts)=1
    ERRO[0006] failed to call tryLoginWithRegHost            error="failed to call rh.Client.Do: Get \"http://ccr.ccs.tencentyun.com:8080/v2/\": EOF" i=0
    FATA[0006] failed to call rh.Client.Do: Get "http://ccr.ccs.tencentyun.com:8080/v2/": EOF
    

    It's strange that nerdctl tries to use port 8080 when the 443 port is ok:

    $ curl https://ccr.ccs.tencentyun.com
    <!DOCTYPE html>
    <html>
    <head>
    <title>Welcome to nginx!</title>
    <style>
        body {
            width: 35em;
            margin: 0 auto;
            font-family: Tahoma, Verdana, Arial, sans-serif;
        }
    </style>
    </head>
    <body>
    <h1>Welcome to nginx!</h1>
    <p>If you see this page, the nginx web server is successfully installed and
    working. Further configuration is required.</p>
    
    <p>For online documentation and support please refer to
    <a href="http://nginx.org/">nginx.org</a>.<br/>
    Commercial support is available at
    <a href="http://nginx.com/">nginx.com</a>.</p>
    
    <p><em>Thank you for using nginx.</em></p>
    </body>
    </html>
    

    I tried docker, it works(at least the network):

    $ docker login --username=test ccr.ccs.tencentyun.com
    Password:
    Get "https://ccr.ccs.tencentyun.com/v2/": unauthorized: authentication required
    

    versions:

    $ nerdctl -v
    nerdctl version 0.16.0
    

    Rancher desktop is 1.0.0

  • Refactor the package structure in cmd/nerdctl

    Refactor the package structure in cmd/nerdctl

    Fix #1631

    First, I'm sorry that I make this PR too large to review. I have to make a one-shot PR if I want to re-structured the directory because the code in the cmd/nerdctl has been mixed,

    In this PR, I have made four things below

    1. split the code file in the cmd/nerdctl into subdirectory which the subcommand has organized
    2. make generic code into a common utils package in the cmd/nerdctl/utils
    3. move the shell-completion feature into completion package in the cmd/nerdct/completion
    4. move all the e2e test together.

    Signed-off-by: Zheao.Li [email protected]

  • Refactor the apparmor flagging process

    Refactor the apparmor flagging process

    CheckList:

    • [x] Create a file in pkg/api/types/${cmd}.go, and define the CommandOption for this command
    • [x] Create some file in pkg/cmd/${cmd}, and move the command entry point in real into this package

    Signed-off-by: Zheao.Li [email protected]

  • [Refactor] Refactor the images command flagging process

    [Refactor] Refactor the images command flagging process

    Checklist:

    • [x] Create a file in pkg/api/types/${cmd}_types.go, and define the CommandOption for this command
    • [x] Create some file in pkg/cmd/${cmd}, and move the command entry point in real into this package

    Signed-off-by: Zheao.Li [email protected]

  • [Refactor] Refactor the load command flagging process

    [Refactor] Refactor the load command flagging process

    Checklist:

    • [x] Create a file in pkg/api/types/${cmd}_types.go, and define the CommandOption for this command
    • [x] Create some file in pkg/cmd/${cmd}, and move the command entry point in real into this package

    Signed-off-by: Zheao.Li [email protected]

  • [Refactor] Refactor the compose command flagging process

    [Refactor] Refactor the compose command flagging process

    • [x] Create a file in pkg/api/types/${cmd}_types.go, and define the CommandOption for this command ~~- [x] Create some file in pkg/cmd/${cmd}, and move the command entry point in real into this package~~

    Signed-off-by: Laitron [email protected]

  • CI: test-integration often hits the 30min limit

    CI: test-integration often hits the 30min limit

    https://github.com/containerd/nerdctl/blob/bbe5c052660000e4ef65c715c6b9e6bba25a9fdb/.github/workflows/test.yml#L61-L63

    We could just increase the timeout, but optimizing the tests to shorten the time might be more preferable

  • --attach in create command

    --attach in create command

    What is the problem you're trying to solve

    Hi, --attach flag is in docker create but not in nerdctl create.

    I'd like to contribute this change in nerdctl but I found --attach is not mentioned in nerdctl create documentation as "unimplemented flag". So before I make the change, just want to confirm that --attach is an expected feature in nerdctl create and there is no implicit reason of not having --attach in nerdctl create intentionally.

    Describe the solution you'd like

    Support --attach in nerdctl create.

    Additional context

    https://docs.docker.com/engine/reference/commandline/create/#options https://github.com/containerd/nerdctl#whale-blue_square-nerdctl-create

  • nerdctl build fails while building Docker/OCI dual-format tar ball

    nerdctl build fails while building Docker/OCI dual-format tar ball

    Description

    While building and exporting an image as an oci format tarball, nerdctl build fails with FATA[0000] unrecognized image format. The build is successful with docker buildx build

    Steps to reproduce the issue

    % echo "FROM public.ecr.aws/docker/library/alpine:3.13" > Dockerfile
    % cat Dockerfile                                                    
    FROM public.ecr.aws/docker/library/alpine:3.13
    % lima nerdctl build -t output:tag --output type=oci,dest=out.tar .
    [+] Building 0.2s (5/5) FINISHED                                                                                                                                                                                      
     => [internal] load build definition from Dockerfile                                                                                                                                                             0.0s
     => => transferring dockerfile: 84B                                                                                                                                                                              0.0s
     => [internal] load .dockerignore                                                                                                                                                                                0.0s
     => => transferring context: 2B                                                                                                                                                                                  0.0s
     => [internal] load metadata for public.ecr.aws/docker/library/alpine:3.13                                                                                                                                       0.1s
     => CACHED [1/1] FROM public.ecr.aws/docker/library/alpine:3.13@sha256:469b6e04ee185740477efa44ed5bdd64a07bbdd6c7e5f5d169e540889597b911                                                                          0.0s
     => => resolve public.ecr.aws/docker/library/alpine:3.13@sha256:469b6e04ee185740477efa44ed5bdd64a07bbdd6c7e5f5d169e540889597b911                                                                                 0.0s
     => exporting to oci image format                                                                                                                                                                                0.1s
     => => exporting layers                                                                                                                                                                                          0.0s
     => => exporting manifest sha256:9280426892c1a5eb6882838461d4e9e5ac9a01c738ff61f031c26204d368ae49                                                                                                                0.0s
     => => exporting config sha256:e2730a754813a28b0f90c47d888aafc6c53ec1bb87da60881ee7fc4e4a99e801                                                                                                                  0.0s
     => => sending tarball                                                                                                                                                                                           0.1s
    FATA[0000] unrecognized image format
    

    Build works successfully with docker buildx build

     % docker buildx  build -t output:tag --output type=oci,dest=out.tar . 
    [+] Building 0.5s (5/5) FINISHED                                                                                                                                                                                      
     => [internal] load .dockerignore                                                                                                                                                                                0.0s
     => => transferring context: 2B                                                                                                                                                                                  0.0s
     => [internal] load build definition from Dockerfile                                                                                                                                                             0.0s
     => => transferring dockerfile: 84B                                                                                                                                                                              0.0s
     => [internal] load metadata for public.ecr.aws/docker/library/alpine:3.13                                                                                                                                       0.4s
     => CACHED [1/1] FROM public.ecr.aws/docker/library/alpine:3.13@sha256:469b6e04ee185740477efa44ed5bdd64a07bbdd6c7e5f5d169e540889597b911                                                                          0.0s
     => => resolve public.ecr.aws/docker/library/alpine:3.13@sha256:469b6e04ee185740477efa44ed5bdd64a07bbdd6c7e5f5d169e540889597b911                                                                                 0.0s
     => exporting to oci image format                                                                                                                                                                                0.1s
     => => exporting layers                                                                                                                                                                                          0.0s
     => => exporting manifest sha256:9280426892c1a5eb6882838461d4e9e5ac9a01c738ff61f031c26204d368ae49                                                                                                                0.0s
     => => exporting config sha256:e2730a754813a28b0f90c47d888aafc6c53ec1bb87da60881ee7fc4e4a99e801                                                                                                                  0.0s
     => => sending tarball
    
    % docker load -i out.tar 
    Loaded image ID: sha256:e2730a754813a28b0f90c47d888aafc6c53ec1bb87da60881ee7fc4e4a99e801
    

    Describe the results you received and expected

    I received an error instead of an image archive.

    What version of nerdctl are you using?

    nerdctl version 1.0.0

    Are you using a variant of nerdctl? (e.g., Rancher Desktop)

    None

    Host information

    Darwin Kernel Version 21.6.0: Sat Jun 18 17:07:22 PDT 2022; root:xnu-8020.140.41~1/RELEASE_ARM64_T6000 arm64

IPFS Collaborative Notebook for Research
IPFS Collaborative Notebook for Research

IPFS Collaborative Notebook for Research What's in This Repo? We use this repo in two ways: Issues to track several kinds of discussion on topics rela

Jan 6, 2023
Go-ipfs-cmds - Cmds offers tools for describing and calling commands both locally and remotely
Go-ipfs-cmds - Cmds offers tools for describing and calling commands both locally and remotely

Go-ipfs-cmds - Cmds offers tools for describing and calling commands both locally and remotely

Jan 18, 2022
CLI to run a docker image with R. CLI built using cobra library in go.
CLI  to run a docker image with R. CLI built using cobra library in go.

BlueBeak Installation Guide Task 1: Building the CLI The directory structure looks like Fastest process: 1)cd into bbtools 2)cd into bbtools/bin 3)I h

Dec 20, 2021
CLI tool to upload object to s3-compatible storage backend and set download policy for it.
CLI tool to upload object to s3-compatible storage backend and set download policy for it.

typora-s3 CLI tool to upload object to s3-compatible storage backend and set download policy for it. Build $ git clone https://github.com/fengxsong/ty

Dec 29, 2021
CLI to support with downloading and compiling terraform providers for Mac with M1 chip

m1-terraform-provider-helper A CLI to help with managing the installation and compilation of terraform providers when running a new M1 Mac. Motivation

Jan 2, 2023
Declarative CLI Version manager. Support Lazy Install and Sharable configuration mechanism named Registry. Switch versions seamlessly

aqua Declarative CLI Version manager. Support Lazy Install and Sharable configuration mechanism named Registry. Switch versions seamlessly. Index Slid

Dec 29, 2022
Tabouli: a TUI for interacting with firmware/embedded devices that support a CLI via serial interface/virtual COM Port
Tabouli: a TUI for interacting with firmware/embedded devices that support a CLI via serial interface/virtual COM Port

Tabouli Information Tabouli is a TUI for interacting with firmware/embedded devi

Apr 2, 2022
🍫 A customisable, universally compatible terminal status bar
🍫 A customisable, universally compatible terminal status bar

Shox: Terminal Status Bar A customisable terminal status bar with universal shell/terminal compatibility. Currently works on Mac/Linux. Installation N

Dec 27, 2022
A client for managing authzed or any API-compatible system from your command line.

zed A client for managing authzed or any API-compatible system from your command line. Installation zed is currently packaged by as a head-only Homebr

Dec 31, 2022
Command-line utility for Postgres-compatible SCRAM-SHA-256 passwords

scram-password -- Command-line utility for Postgres-compatible SCRAM-SHA-256 passwords SCRAM-SHA-256 (see RFC-7677, Salted Challenge Response Authenti

Jan 21, 2022
Trzsz-go - A simple file transfer tools, similar to lrzsz ( rz / sz ), and compatible with tmux

Trzsz-go - A simple file transfer tools, similar to lrzsz ( rz / sz ), and compatible with tmux

Dec 31, 2022
archy is an static binary to determine current kernel and machine architecture, with backwards compatible flags to uname, and offers alternative output format of Go runtime (i.e. GOOS, GOARCH).

archy archy is an simple binary to determine current kernel and machine architecture, which wraps uname and alternatively can read from Go runtime std

Mar 18, 2022
Elegant CLI wrapper for kubeseal CLI

Overview This is a wrapper CLI ofkubeseal CLI, specifically the raw mode. If you just need to encrypt your secret on RAW mode, this CLI will be the ea

Jan 8, 2022
A wrapper of aliyun-cli subcommand alidns, run aliyun-cli in Declarative mode.

aliyun-dns A wrapper of aliyun-cli subcommand alidns, run aliyun-cli in Declarative mode. Installation Install aliyun-cli. Usage $ aliyun-dns -h A wra

Dec 21, 2021
Symfony-cli - The Symfony CLI tool For Golang

Symfony CLI Install To install Symfony CLI, please download the appropriate vers

Dec 28, 2022
Go-file-downloader-ftctl - A file downloader cli built using golang. Makes use of cobra for building the cli and go concurrent feature to download files.

ftctl This is a file downloader cli written in Golang which uses the concurrent feature of go to download files. The cli is built using cobra. How to

Jan 2, 2022
Cli-algorithm - A cli program with A&DS in go!

cli-algorithm Objectives The objective of this cli is to implement 4 basic algorithms to sort arrays been Merge Sort Insertion Sort Bubble Sort Quick

Jan 2, 2022
Nebulant-cli - Nebulant's CLI
Nebulant-cli - Nebulant's CLI

Nebulant CLI Website: https://nebulant.io Documentation: https://nebulant.io/docs.html The Nebulant CLI tool is a single binary that can be used as a

Jan 11, 2022