From 54cbe153b0f485a071b3f0225672191cf033cf1c Mon Sep 17 00:00:00 2001 From: ynqa Date: Thu, 16 Aug 2018 16:19:21 +0900 Subject: [PATCH] Improve dockerfile --- .dockerignore | 1 + .travis.yml | 1 + Dockerfile | 9 +++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..48b8bf9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +vendor/ diff --git a/.travis.yml b/.travis.yml index e044d80..f5c6dc2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: go go: - 1.9 + - 1.10 - tip services: diff --git a/Dockerfile b/Dockerfile index 67d6afd..39aa4a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,8 @@ -FROM golang:1.9-alpine AS builder +FROM golang:1.10.3-alpine3.8 AS builder + +RUN apk update \ + && apk add --no-cache git \ + && go get -u github.com/golang/dep/cmd/dep ENV CGO_ENABLED=0 ENV GOOS=linux @@ -6,7 +10,8 @@ ENV GOARCH=amd64 WORKDIR /go/src/github.com/ynqa/wego COPY . . -RUN go build -o wego . +RUN dep ensure -v -vendor-only +RUN go build -v -o wego . FROM busybox COPY --from=builder /go/src/github.com/ynqa/wego/wego /usr/local/bin/wego