Skip to content

Commit 896a19b

Browse files
committed
feat: add Dockerfile
1 parent b971620 commit 896a19b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.gitignore
3+
.dockerignore
4+
Dockerfile
5+
vendor

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM golang:1.11-alpine3.8 as vendor
2+
WORKDIR /go/src/github.com/orisano/targd
3+
RUN apk add --no-cache git
4+
RUN wget -O- https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
5+
COPY Gopkg.toml Gopkg.lock ./
6+
RUN dep ensure -vendor-only && rm -rf /go/pkg/dep/sources
7+
8+
FROM golang:1.11-alpine3.8 as build
9+
WORKDIR /go/src/github.com/orisano/targd
10+
RUN apk add --no-cache gcc musl-dev
11+
COPY --from=vendor /go/src/github.com/orisano/targd .
12+
COPY . .
13+
RUN go build -o /bin/targd
14+
15+
FROM alpine:3.8
16+
COPY --from=build /bin/targd /bin/
17+
ENTRYPOINT ["/bin/targd"]
18+

0 commit comments

Comments
 (0)