-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (30 loc) · 1.16 KB
/
Dockerfile
File metadata and controls
42 lines (30 loc) · 1.16 KB
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
37
38
39
40
41
42
FROM golang:1.25-alpine AS builder
ENV CGO_ENABLED=0
WORKDIR /srv
RUN apk add --no-cache --update git bash curl tzdata && \
cp /usr/share/zoneinfo/Asia/Almaty /etc/localtime && \
rm -rf /var/cache/apk/*
COPY ./cmd /srv/cmd
COPY ./groxypb /srv/groxypb
COPY ./pkg /srv/pkg
COPY ./go.mod /srv/go.mod
COPY ./go.sum /srv/go.sum
COPY ./.git/ /srv/.git
RUN \
export version="$(git describe --tags --long)" && \
echo "version: $version" && \
go build -o /go/build/groxy -ldflags "-X 'main.version=${version}' -s -w" /srv/cmd/groxy
FROM alpine:3.22 AS base
RUN apk add --no-cache --update tzdata && \
cp /usr/share/zoneinfo/Asia/Almaty /etc/localtime && \
rm -rf /var/cache/apk/*
FROM scratch
LABEL org.opencontainers.image.source="https://github.com/Semior001/groxy"
LABEL maintainer="Semior <ura2178@gmail.com>"
COPY --from=builder /go/build/groxy /usr/bin/groxy
COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=base /etc/passwd /etc/passwd
COPY --from=base /etc/group /etc/group
WORKDIR /etc/groxy
ENTRYPOINT ["/usr/bin/groxy", "--file.name", "/etc/groxy/config.yaml"]