forked from goproxy/goproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (29 loc) · 881 Bytes
/
Dockerfile
File metadata and controls
36 lines (29 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM golang:1.23-alpine3.21 AS build
ARG USE_GORELEASER_ARTIFACTS=0
ARG GORELEASER_ARTIFACTS_TARBALL
WORKDIR /usr/local/src/goproxy
COPY . .
RUN set -eux; \
if [ "${USE_GORELEASER_ARTIFACTS}" -eq 1 ]; then \
tar -xzf "${GORELEASER_ARTIFACTS_TARBALL}" bin/goproxy; \
else \
apk add --no-cache git; \
go mod download; \
CGO_ENABLED=0 go build \
-trimpath \
-ldflags "-s -w -X github.com/goproxy/goproxy/cmd/goproxy/internal.Version=$(git describe --dirty --tags --always)" \
-o bin/ \
./cmd/goproxy; \
fi
FROM alpine:3.21
COPY --from=build /usr/local/src/goproxy/bin/ /usr/local/bin/
RUN apk add --no-cache go git git-lfs openssh gpg subversion fossil mercurial breezy
RUN git lfs install --system
USER nobody
WORKDIR /go
VOLUME /go
WORKDIR /goproxy
VOLUME /goproxy
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/goproxy"]
CMD ["server", "--address", ":8080"]