mirror of
https://github.com/onyx-and-iris/q3rcon-proxy.git
synced 2025-01-18 16:50:54 +00:00
use multi-stage build
This commit is contained in:
parent
c42df03858
commit
939d419438
12
Dockerfile
12
Dockerfile
@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.21
|
FROM golang:1.21 AS build_image
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
@ -8,7 +8,13 @@ RUN go mod download && go mod verify
|
|||||||
|
|
||||||
# build binary and place into /usr/local/bin/
|
# build binary and place into /usr/local/bin/
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go build -v -o /usr/local/bin/q3rcon-proxy ./cmd/q3rcon-proxy/
|
RUN CGO_ENABLED=0 GOOS=linux go build -o ./bin/q3rcon-proxy ./cmd/q3rcon-proxy/
|
||||||
|
|
||||||
|
FROM scratch AS final_image
|
||||||
|
|
||||||
|
WORKDIR /bin/
|
||||||
|
|
||||||
|
COPY --from=build_image /usr/src/app/bin/q3rcon-proxy .
|
||||||
|
|
||||||
# Command to run when starting the container
|
# Command to run when starting the container
|
||||||
ENTRYPOINT [ "q3rcon-proxy" ]
|
ENTRYPOINT [ "./q3rcon-proxy" ]
|
Loading…
Reference in New Issue
Block a user