Back to Dagger

Nerdctl

docs/versioned_docs/version-0.18.19/reference/container-runtimes/nerdctl.mdx

0.21.51.4 KB
Original Source

Nerdctl

Dagger can be used with any OCI-compatible container runtime, including nerdctl.

How it works

By default, Dagger tries to invoke the docker executable. Since nerdctl is CLI-compatible with Docker, it can be used as a drop-in replacement. This is as simple as creating a symbolic link to the nerdctl executable in your system path and naming it docker.

Prerequisites

  • nerdctl installed and running on the host system in rootless mode.

Example

  • To use nerdctl with Dagger, create a symbolic link as below:

    shell
    sudo ln -s $(which nerdctl) /usr/local/bin/docker
    
  • To use nerdctl with Dagger via lima, create the following shell script at /usr/local/bin/nerdctl:

    shell
    #!/bin/sh
    lima nerdctl "$@"
    

    Then, create a symbolic link to the shell script and name it docker:

    shell
    sudo ln -s /usr/local/bin/nerdctl /usr/local/bin/docker
    

Resources

If you have any questions about additional ways to use nerdctl with Dagger, join our Discord and ask your questions in our help channel.

About nerdctl

nerdctl is a Docker-compatible tool to manage and run containers.