version: 2
jobs:
  build:
    docker:
      - image: sicz/dockerspec:3.6
    working_directory: ~/docker-dockerspec
    environment:
      - MAKEFLAGS=--no-print-directory
    steps:
      - run:
          name: Set up Environment
          command: |
            curl -sSL https://github.com/SICZ/Mk/archive/master.tar.gz | tar -xzf -
            mv Mk-master ~/Mk
      - checkout
      - setup_remote_docker:
          version: 17.06.0-ce
      - run:
          name: Remote Docker engine version
          command: |
            docker version
      - run:
          name: Build and test latest Docker image
          command: |
            make rebuild
            make run
            make logs
            make rspec DOCKER_RSPEC_FORMAT=doc
      - run:
          name: Build and test development Docker image
          command: |
            cd devel
            make rebuild
            make run
            make logs
            make rspec DOCKER_RSPEC_FORMAT=doc
      - deploy:
          name: Push images to Docker Hub
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              docker login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_PASSWD}
              make docker-push
              cd devel
              make docker-push
            fi

version: 2
jobs:
  build:
    docker:
      - image: sicz/dockerspec@sha256:ac15e88ddfd8e8b524857e3ccb742bdf0c12385f9de59269e1150474f1312d84
    working_directory: ~/docker-dockerspec
    environment:
      - MAKEFLAGS=--no-print-directory
    steps:
      - run:
          name: Set up Environment
          command: |
            curl -sSL https://github.com/SICZ/Mk/archive/master.tar.gz | tar -xzf -
            mv Mk-master ~/Mk
      - checkout
      - setup_remote_docker:
          version: 17.06.0-ce
      - run:
          name: Remote Docker engine version
          command: |
            docker version
      - run:
          name: Build and test development Docker image
          command: |
            cd devel
            make rebuild
            make run
            make logs
            make rspec DOCKER_RSPEC_FORMAT=doc
      - run:
          name: Build and test latest Docker image
          command: |
            make rebuild
            make run
            make logs
            make rspec DOCKER_RSPEC_FORMAT=doc
      - deploy:
          name: Push images to Docker Hub
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              docker login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_PASSWD}
              make docker-push
              cd devel
              make docker-push
            fi

Use Docker image digest for CircleCI Docker executor
Use Docker image digest for CircleCI Docker executor
