Skip to content

Commit 04194d0

Browse files
committed
Added a Dockerfile.
1 parent 2145e80 commit 04194d0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Diff for: Dockerfile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# syntax=docker/dockerfile:1.1.7-experimental
2+
3+
# Environment to build manager binary
4+
FROM golang:1.15.6-alpine3.12 as build
5+
WORKDIR /gin
6+
7+
RUN apk update && apk add gcc musl-dev
8+
9+
COPY . .
10+
11+
RUN go mod download
12+
13+
RUN go build -ldflags '-w -s' -a -o ./bin/porter-gin-example .
14+
15+
# Deployment environment
16+
# ----------------------
17+
FROM alpine:3.12
18+
WORKDIR /gin
19+
20+
RUN apk update && apk add git curl
21+
22+
COPY --from=build /gin/bin/porter-gin-example /usr/bin/
23+
24+
ENTRYPOINT [ "porter-gin-example" ]
25+

0 commit comments

Comments
 (0)