improve container build
Some checks failed
build container / build-container (push) Failing after 4m43s

This commit is contained in:
guochao 2025-02-23 12:07:05 +08:00
parent 27634d016b
commit 3cfa6c6116
2 changed files with 5 additions and 3 deletions

View File

@ -1,8 +1,9 @@
FROM docker.io/library/golang:1.23-alpine
ARG GOPROXY
ARG GOPROXY=direct
ARG ALPINE_MIRROR=https://mirrors.ustc.edu.cn
WORKDIR /src
COPY go.mod go.sum ./
RUN apk add git && env GOPROXY=${GOPROXY:-direct} go mod download
RUN sed -i "s,https://dl-cdn.alpinelinux.org,${ALPINE_MIRROR}," /etc/apk/repositories; apk add git && env GOPROXY=${GOPROXY:-direct} go mod download
ADD . /src
RUN go build -o /cache-proxy ./cmd/proxy

View File

@ -1,9 +1,10 @@
services:
cache-proxy:
image: 100.64.0.2:3000/guochao/cache-proxy
image: 100.64.0.2:3000/guochao/cache-proxy:${VERSION:-latest}
build:
args:
GOPROXY: ${GOPROXY:-direct}
ALPINE_MIRROR: ${ALPINE_MIRROR:-https://mirrors.ustc.edu.cn}
pull_policy: always
restart: always