2024-10-31 09:14:35 +07:00
# Start by building the application.
FROM docker.io/golang:1.22 AS build
WORKDIR /usr/src/transocks
COPY . .
2024-10-31 13:23:59 +07:00
RUN CGO_ENABLED = 0 go build -trimpath -o transocks ./cmd/transocks
2024-10-31 09:14:35 +07:00
# Now copy it into our base image.
2024-10-31 13:12:46 +07:00
FROM gcr.io/distroless/static-debian12:nonroot
2024-10-31 09:14:35 +07:00
COPY --from= build /usr/src/transocks/transocks /usr/bin/transocks
VOLUME [ "/etc/transocks" ]
ENTRYPOINT [ "/usr/bin/transocks" ]
ARG IMAGE_CREATED
ARG IMAGE_VERSION
ARG IMAGE_REVISION
LABEL org.opencontainers.image.created= " ${ IMAGE_CREATED } " \
org.opencontainers.image.authors= "MouseSoft" \
2024-10-31 13:12:46 +07:00
org.opencontainers.image.url= "https://git.mousesoft.ru/alexey/transocks" \
org.opencontainers.image.documentation= "https://git.mousesoft.ru/alexey/transocks/src/branch/master/README.md" \
org.opencontainers.image.source= "https://git.mousesoft.ru/alexey/transocks" \
2024-10-31 09:14:35 +07:00
org.opencontainers.image.version= " ${ IMAGE_VERSION } " \
org.opencontainers.image.revision= " ${ IMAGE_REVISION } " \
org.opencontainers.image.vendor= "MouseSoft" \
org.opencontainers.image.licenses= "MIT" \
org.opencontainers.image.title= "transocks - a transparent SOCKS5/HTTP proxy" \
org.opencontainers.image.description= "transocks is a background service to redirect TCP connections transparently to a SOCKS5 server or a HTTP proxy server like Squid."