This repository was archived by the owner on Nov 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ version : 2
2+ jobs :
3+ build :
4+ docker :
5+ - image : docker:18.06.1-ce-git
6+ working_directory : ~/whereabouts
7+ steps :
8+ - checkout
9+ - setup_remote_docker :
10+ version : 18.05.0-ce
11+ - run : docker build --pull -t ${DOCKER_HUB_IMAGE} .
12+ - run : mkdir -p workspace
13+ - run : docker save ${DOCKER_HUB_IMAGE} | gzip > image.tar.gz
14+ - persist_to_workspace :
15+ root : workspace
16+ paths :
17+ - image.tar.gz
18+ deploy :
19+ docker :
20+ - image : docker:18.06.1-ce
21+ working_directory : ~/whereabouts
22+ steps :
23+ - attach_workspace :
24+ at : workspace
25+ - setup_remote_docker :
26+ version : 18.05.0-ce
27+ - deploy :
28+ name : Deploy the image to Docker Hub
29+ command : |
30+ zcat workspace/image.tar.gz | docker load
31+ docker tag ${DOCKER_HUB_IMAGE} ${DOCKER_HUB_IMAGE}:${CIRCLE_TAG}
32+ docker login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_PASS}
33+ docker push ${DOCKER_HUB_IMAGE}:${CIRCLE_TAG}
34+ docker push ${DOCKER_HUB_IMAGE}
35+
36+ workflows :
37+ version : 2
38+ build-and-deploy :
39+ jobs :
40+ - build
41+ - deploy :
42+ required :
43+ - build
44+ filters :
45+ tags :
46+ only : /^v[0-9]+\.[0-9]+\.[0-9]+$/
Original file line number Diff line number Diff line change 1- FROM golang:1.8 -alpine AS builder
1+ FROM golang:1.11 -alpine AS builder
22WORKDIR /go/src/whereabouts
33COPY . .
44RUN CGO_ENABLED=0 go build -o /whereabouts -ldflags="-s -w"
55
6- FROM alpine:3.6
6+ FROM alpine:3.8
77RUN apk --no-cache add ca-certificates
88COPY --from=builder /whereabouts /
99RUN adduser -D app && chown app:app /whereabouts
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments