调整构建Dockerfile

This commit is contained in:
walker 2023-08-08 09:34:18 +08:00
parent 437bd8146b
commit 4615597260

View File

@ -1,9 +1,10 @@
FROM golang:1.20.7 as builder FROM golang:1.20-alpine as builder
WORKDIR /go/src/joylink.club/bj-rtsts-server WORKDIR /go/src/joylink.club/bj-rtsts-server
COPY . ./ COPY . ./
RUN go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct && go build -o bj-rtsts-server RUN go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct && go build -o bj-rtsts-server
FROM scratch FROM scratch
COPY --from=builder /go/src/joylink.club/bj-rtsts-server/bj-rtsts-server /go/src/joylink.club/bj-rtsts-server/config.yml ./ COPY --from=builder /go/src/joylink.club/bj-rtsts-server/bj-rtsts-server /usr/local/bin/bj-rtsts-server
WORKDIR /bj-rtsts WORKDIR /bj-rtsts
COPY --from=builder /go/src/joylink.club/bj-rtsts-server/config.yml .
CMD [ "bj-rtsts-server" ] CMD [ "bj-rtsts-server" ]