Deploying using Docker Images

Note: currently Deis requires you to use Docker 1.5

You can also deploy fully-backed Docker images — for examples those created by your continuous integration system.

Images must be pushed to Docker hub (or a private registry) prior to deployment on Deis.

Note: support for Docker registry authentication is coming soon. This means your image must be public.

Build and Push The Image

As with using a Dockerfile, you must still adhere to the following when deploying to Deis:

  1. The docker image must EXPOSE only one port
  2. The port must be listening for a HTTP connection
  3. A default CMD must be specified for running the container

Once you have a Dockerfile that meets this criteria, you can build the docker image like so:

$ docker build -t <username>/<image> . # Don't forget the period at the end!
$ docker push <username>/<image>:latest

Note: You can test this in the root of the repository for this tutorial

Deploying to Deis

To deploy, we must first create an application on the controller, which requires a local working directory:

$ mkdir -p /tmp/app-name
$ cd /tmp/app-name
$ deis create

Note: The deis client uses the name of the current directory as the default app name.

Then you can have Deis simply pull the image and deploy it:

$ deis pull <username>/<image>:latest

To verify that it deployed successfully, you can run deis open to pull up the site in your browser.