Skip to main content

Loading an image into a docker engine


This documentation is for an older version of Dagger, which is no longer actively maintained.

We encourage you to upgrade and refer to the documentation for the most current version.

If you cannot upgrade to the latest version, please contact us in the help forum on Discord. When contacting us, please let us know why you cannot move to the latest version. From there, our team will work with you on your use case.

Dagger can build, run, push and pull docker images natively, without the need of a Docker engine. This feature is available in the package

However, sometimes after building an image, you specifically want to load it into your Docker engine. This is possible with the Docker CLI package:

Using cli.#Load, you can load an image built by Dagger into a local or remote engine. It can be useful to debug or test a build locally before pushing.

Local daemon

Remote daemon, via SSH

package main

import (

dagger.#Plan & {
client: filesystem: {
"~/.ssh/id_rsa": read: contents: dagger.#Secret
"~/.ssh/known_hosts": read: contents: dagger.#Secret

actions: {
build: docker.#Build & {

load: cli.#Load & {
image: build.output
tag: "myimage:v2"
host: "ssh://root@"
ssh: {
key: client.filesystem."~/.ssh/id_rsa".read.contents
knownHosts: client.filesystem."~/.ssh/known_hosts".read.contents