参考如下,基于golang:1.14-alpine构建

  - name: build
    image: golang:1.14-alpine
    commands:
      - go build -v -tags "" -ldflags "-extldflags "-static"  -s -w -X 'main.DroneBuildNumber=${DRONE_BUILD_NUMBER}' "  -o api
    volumes:
      - name: gopath
        path: /go
来源:中战博客,欢迎分享!
标签: go,golang,docker,exec user process caused