# References: # 1. https://circleci.com/blog/how-to-build-a-docker-image-on-circleci-2-0/ # 2. https://circleci.com/docs/2.0/building-docker-images/ # version: 2 jobs: build: working_directory: /app docker: - image: docker:17.06.1-ce environment: BMO_IMAGE_NAME: mozillabteam/bmo steps: - setup_remote_docker - run: name: install git and ssh command: apk update && apk add git openssh-client - checkout - run: | docker build -t $BMO_IMAGE_NAME:$CIRCLE_BRANCH . if [[ -n "$DOCKER_USER" && -n "$DOCKER_PASS" ]]; then docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" docker push $BMO_IMAGE_NAME:$CIRCLE_BRANCH fi