This repository has been archived by the owner. It is now read-only.
No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Dockerfile Update Dockerfile Sep 29, 2015 Update Jan 15, 2016
circle.yml Cache image layers Dec 18, 2014


This is a simple example of building a Docker image from a Dockerfile using CircleCI's native Docker support, starting a new container from the built image, running some tests against the container, then deploying the image to Docker Hub.

##The image

The image built in this example is an ElasticSearch node. It is borrowed from the official ElasticSearch Dockerfile maintained at dockerfile/elasticsearch.

##Building and testing with CircleCI

Building the docker image on CircleCI is as simple as requiring the docker service to be present and running docker build as usual. A container can then be created from the image using docker run, and various tests can be run against the container. See the file circle.yml for details, or refer to the CircleCI docs for Docker.

##Deploying to Docker Hub

This example also deploys the built image to Docker Hub after successfully building and testing. See the deployment section of circle.yml for details on how this is done. Note that three environment variables need to be set on CircleCI for the deployment to work:

  • DOCKER_EMAIL - The email address associated with the user with push access to the Docker Hub repository
  • DOCKER_USER - Docker Hub username
  • DOCKER_PASS - Docker Hub password (these are all stored encrypted on CircleCI, and you can create a deployment user with limited permission on Docker Hub if you like)

Also note that the Docker Hub repository name and Docker registry endpoint are hard-coded into circle.yml and would need to be changed to deploy to a different repository or registry.

##See also