Skip to content

Commit ff7fed2

Browse files
committed
added Dockerfile
1 parent 25bdca2 commit ff7fed2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM golang:1.21-alpine As builder
2+
3+
WORKDIR /phoo/
4+
5+
RUN apk update && apk add git upx
6+
7+
COPY go.mod go.sum ./
8+
9+
RUN go mod download
10+
11+
COPY . .
12+
13+
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o /usr/bin/phoo ./cmd/
14+
15+
RUN upx -9 /usr/bin/phoo
16+
17+
FROM alpine
18+
19+
WORKDIR /phoo/
20+
21+
COPY --from=builder /usr/bin/phoo /usr/bin/phoo

0 commit comments

Comments
 (0)