CircleCI build golang docker image

Submitted by Lizhe on Tue, 10/20/2020 - 10:20

 

version: 2

jobs:

  build:

    docker:

      - image: golang:alpine3.12

        auth:

          username: libaibai

          password: $password

 

    steps:

      - checkout

      - setup_remote_docker:

          version: 19.03.13

          docker_layer_caching: false

      - run:

          name: Install Docker client

          command: apk add docker-cli

      - run: |

          TAG=0.1

          docker build -t libaibai/circleci-demo-docker:v1 .

          echo $password | docker login -u libaibai --password-stdin

          docker push libaibai/circleci-demo-docker:v1