Skip to content

Instantly share code, notes, and snippets.

@u2mejc
Last active January 13, 2017 23:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save u2mejc/79a1b0081c2a55b1b1c64b5fbdb28738 to your computer and use it in GitHub Desktop.
Save u2mejc/79a1b0081c2a55b1b1c64b5fbdb28738 to your computer and use it in GitHub Desktop.
Tagging Docker images and deploying with Dokku

Deploying Tags in Dokku

Dokku is an tiny open source PAAS. Pulling and tagging existing images isn't a directly supported feature inside Dokku, so you must use Docker to first pull a tag the image.

  • Use Docker to login to Docker Hub if the repo isn't public
$ sudo docker -u <dockerhub_username>

Note: -p is only used when passing the password in line

  • Pull the image from Docker Hub
$ sudo docker pull <organization/image_name>:<version_tag>
  • Dokku manages containers assuming the organization (the prepended name before the /) is dokku. You need to prepend your images with dokku/ after pulling and remove the organization or replace the second / with a -.
$ sudo docker tag <organization/image_name>:<version_tag> dokku/<organization>-<image_name>:<version_tag>
  • Dokku works in an app paradigm, instead of containers. First Dokku step is to create the new app (if this is the first deploy):
$ sudo dokku apps:create <app_name>

Note: Do not use / in the name of the app, use - instead if required.

  • Your Dokku tagged Docker images (from here on out, known as apps) should now be visible inside Dokku:
$ dokku tags <app_name>
  • You should now be able to deploy you application based on the tag you would like deployed.
$ sudo dokku tags:deploy <app_name> <version_tag>

Gotcha: Listen ports are specified by the image, you can change these at the image level or via Dokku's proxy sub-command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment