Skip to content
This repository was archived by the owner on Nov 5, 2019. It is now read-only.
This repository was archived by the owner on Nov 5, 2019. It is now read-only.

Setup automated build on DockerHub #26

Open
@ibnesayeed

Description

@ibnesayeed

Hey there, thank you for submitting an issue!

We are trying to keep issues for feature requests and bug reports. Please
complete the following checklist before creating a new one:

  • feature request

Currently, images are build from inside the Circle CI and pushed to the DockerHub. This requires the CI system to install docker client as well as have access to the DockerHub credentials. An alternate approach would be to use the Automated Builds feature of DockerHub or Docker Cloud (both are free for public images). This setup can clean the following blocks from the .circleci/config.yml file:

      - run:
          name: Install Docker client
          command: |
            if [ $CIRCLE_BRANCH = 'master' ]; then
              set -x
              VER="17.03.0-ce"
              curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
              tar -xz -C /tmp -f /tmp/docker-$VER.tgz
              mv /tmp/docker/* /usr/bin
            fi
      - run:
          name: Publish to Docker Hub
          command: |
            if [ $CIRCLE_BRANCH = 'master' ]; then
              TAG=0.1.$CIRCLE_BUILD_NUM
              docker build -t datatogether/coverage:latest -t datatogether/coverage:$TAG .
              docker login -u $DOCKER_USER -p $DOCKER_PASS
              docker push datatogether/coverage:$TAG
              docker push datatogether/coverage:latest
            fi

The following image illustrates an automated build setup that would:

  • build an image with master tag on every single commit to the master branch and
  • build two images latest and {release-tag} every time a release is tagged (using GitHub's Releases feature)

This way, the latest tag is always pointing to a stable build while keeping a history of all releases along with bleeding edge master image.

docker-auto-build-settings

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions