Skip to content

Commit

Permalink
Improve dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ynqa committed Aug 16, 2018
1 parent 6e4f584 commit 54cbe15
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: go

go:
- 1.9
- 1.10
- tip

services:
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
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
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
Expand Down

0 comments on commit 54cbe15

Please sign in to comment.