优化Dockerfile
This commit is contained in:
@@ -5,20 +5,17 @@ COPY go.mod go.sum ./
|
|||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ghproxy .
|
||||||
|
|
||||||
FROM alpine:3.20
|
FROM alpine
|
||||||
|
|
||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
|
|
||||||
# 安装skopeo
|
# 安装skopeo
|
||||||
RUN apk add --no-cache skopeo
|
RUN apk add --no-cache skopeo && mkdir -p temp && chmod 700 temp
|
||||||
|
|
||||||
# 创建临时目录
|
COPY --from=builder /app/ghproxy .
|
||||||
RUN mkdir -p ./temp && chmod 777 ./temp
|
|
||||||
|
|
||||||
COPY --from=builder /app/main .
|
|
||||||
COPY --from=builder /app/config.json .
|
COPY --from=builder /app/config.json .
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
|
|
||||||
CMD ["./main"]
|
CMD ["./ghproxy"]
|
||||||
|
|||||||
Reference in New Issue
Block a user