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.
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:
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.
Alternatively, you can save the image and load it in one command like so:
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.