Skip to content

Deploying an image without a registry

To deploy an image from CI without an intermediate registry, we can run the following series of commands.

Note

This tutorial assumes the app being deployed is named node-js-app and the Dokku server's hostname is dokku.me. Please modify these values as appropriate.

Building the image

First, we'll assume the image is built. The following is one example for building a docker image, though your setup may vary. The image repository must not be dokku/, as that namespace is used internally for tagging images by Dokku.

docker image build --tag app/node-js-app:2935cc3d .

It is recommended to tag your image with a unique tag per build, as otherwise the deployment step becomes tricky. A good tag to use is the commit sha of your build, which is usually provided by your CI provider of choice.

Loading the image onto the host

Next, we save the image to a file. This can be done with the docker image save command:

docker image save --ouput node-js-app.tar

The image must then be loaded on the remote server. This should be performed with the docker load command, and must be performed by a user that has access to the docker daemon.

cat node-js-app.tar | ssh root@dokku.me "docker load"

Alternatively, you can save the image and load it in one command like so:

docker image save | ssh root@dokku.me "docker load"

Warning

Because this command is not exposed by Dokku, a user other than dokku must be used for the ssh command.

Deploying the image

Finally, we can deploy the image using the git:from-image Dokku command.

ssh dokku@dokku.me git:from-image node-js-app app/node-js-app:2935cc3d