2025-02-25 09:56:30 +08:00
|
|
|
FROM docker.io/library/golang:1.24-alpine
|
2025-02-23 12:07:05 +08:00
|
|
|
ARG GOPROXY=direct
|
|
|
|
ARG ALPINE_MIRROR=https://mirrors.ustc.edu.cn
|
2024-12-18 10:47:18 +08:00
|
|
|
WORKDIR /src
|
2024-12-18 10:51:29 +08:00
|
|
|
COPY go.mod go.sum ./
|
2025-02-23 12:07:05 +08:00
|
|
|
RUN sed -i "s,https://dl-cdn.alpinelinux.org,${ALPINE_MIRROR}," /etc/apk/repositories; apk add git && env GOPROXY=${GOPROXY:-direct} go mod download
|
2024-12-18 10:51:29 +08:00
|
|
|
ADD . /src
|
2024-12-18 10:47:18 +08:00
|
|
|
RUN go build -o /cache-proxy ./cmd/proxy
|
|
|
|
|
2025-02-06 00:34:54 +08:00
|
|
|
FROM docker.io/library/alpine:3.21 AS runtime
|
2024-12-18 10:47:18 +08:00
|
|
|
COPY --from=0 /cache-proxy /bin/cache-proxy
|
2025-01-30 23:58:59 +08:00
|
|
|
WORKDIR /
|
2024-12-18 10:47:18 +08:00
|
|
|
VOLUME /data
|
|
|
|
CMD cache-proxy
|