Skip to content

Commit 4cb4eae

Browse files
Create go.md
1 parent 968d310 commit 4cb4eae

File tree

1 file changed

+22
-0
lines changed
  • recipes/containers/docker

1 file changed

+22
-0
lines changed

recipes/containers/docker/go.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Go
2+
3+
```dockerfile
4+
FROM golang:1.20 as builder
5+
6+
WORKDIR /app
7+
8+
COPY go.mod go.sum ./
9+
RUN go mod download
10+
11+
COPY . .
12+
13+
RUN CGO_ENABLED=0 GOOS=linux go build -o myapp .
14+
15+
FROM alpine:latest
16+
17+
WORKDIR /root/
18+
19+
COPY --from=builder /app/myapp .
20+
21+
CMD ["./myapp"]
22+
```

0 commit comments

Comments
 (0)