Skip to content

Commit

Permalink
Build Docker Image
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed Apr 17, 2018
1 parent d458922 commit e81de0a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,16 @@ test_task:
CIRRUS_WORKING_DIR: /go/src/github.com/$CIRRUS_REPO_FULL_NAME
get_script: go get -t -v ./...
vet_script: go vet -v ./...
test_script: go test -v ./...
test_script: go test -v ./...

deploy_docker_builder:
only_if: $CIRRUS_BRANCH == "master"
depends_on: test
environment:
DOCKER_USER_NAME: ENCRYPTED[81138e1a6e2213ac2c2ab7fe39ac91c304928046e984a2a947aab3ed3860802b9a95a72206ba0769f00bbe4f21a84c2d]
DOCKER_PASSWORD: ENCRYPTED[61d7105b225c7aae7fabe036dff68618f31ec89ac6ccd16b00d9de69c80ceb7aec02e3c5b9c19aa24379553177fc5b00]
build_script:
- docker build --tag cirrusci/google-storage-proxy:latest .
push_script:
- docker login --username $DOCKER_USER_NAME --password $DOCKER_PASSWORD
- docker push cirrusci/google-storage-proxy:latest
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:1.10-alpine as builder

RUN apk update && apk upgrade && \
apk add --no-cache git

WORKDIR /go/src/github.com/cirruslabs/google-storage-proxy
ADD . /go/src/github.com/cirruslabs/google-storage-proxy

RUN go get -t -v ./... && \
go test -v ./... && \
go build -o google-storage-proxy ./cmd/

FROM alpine
WORKDIR /svc
COPY --from=builder /go/src/github.com/cirruslabs/google-storage-proxy/google-storage-proxy /svc/
ENTRYPOINT ["/svc/google-storage-proxy"]

0 comments on commit e81de0a

Please sign in to comment.