Skip to content

Commit 389a2d7

Browse files
committed
fix docker build
1 parent 3944a49 commit 389a2d7

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Dockerfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
FROM golang:1.19
2-
WORKDIR /go/src/github.com/gw2auth/http-echo/
1+
FROM golang:1.26 AS builder
2+
3+
WORKDIR /build
4+
35
COPY go.mod ./
4-
COPY main.go ./
5-
RUN CGO_ENABLED=0 go build -a -o app
6+
RUN go mod download
7+
8+
COPY ../.. ./
9+
RUN CGO_ENABLED=0 go build -o http-echo
610

7-
FROM alpine:latest
8-
WORKDIR /root/
9-
COPY --from=0 /go/src/github.com/gw2auth/http-echo/app ./app
10-
CMD ["/root/app"]
11+
FROM scratch
12+
COPY --from=builder /build/http-echo /http-echo
13+
EXPOSE 8080
14+
ENTRYPOINT ["/http-echo"]

0 commit comments

Comments
 (0)