mirror of
https://github.com/3proxy/3proxy.git
synced 2026-04-12 16:00:11 +08:00
- Build distroless from scratch - Static linking with NOSTDRESOLVE for minimal - SSLPlugin is supported in full, including chroot configuration - No need to specify full path for plugins chroot provides no additional security due to distroless, but is still supported for compatiblity reasons. Plugins, including SSL should work in chroot configuration. --read-only is recommended, no tmp directories are required.
39 lines
1.1 KiB
Docker
39 lines
1.1 KiB
Docker
# dockerfile for "interactive" minimal 3proxy execution, no configuration mounting is required, configuration
|
|
# is accepted from stdin. Use "end" command to indicate the end of configuration. Use "log" for stdout logging.
|
|
#
|
|
# Examples are for podman. For docker change 'podman' to 'docker'.
|
|
#
|
|
# This is busybox based docker with only 3proxy static executable.
|
|
#
|
|
# Limitations for minimal version:
|
|
# no support for plugins, IPv6, RADIUS, system resolver.
|
|
# 'nserver' or 'fakeresolve' are mandatory in configuration.
|
|
#
|
|
# Build:
|
|
#
|
|
# podman build -f Dockerfile.minimal -t 3proxy.minimal .
|
|
#
|
|
# Run example:
|
|
#
|
|
# podman run --read-only -i -p 3129:3129 --name 3proxy 3proxy.minimal
|
|
#or
|
|
# podman start -ai 3proxy
|
|
#<nserver 8.8.8.8
|
|
#<nscache 65535
|
|
#<log
|
|
#<proxy -p3129
|
|
#<end
|
|
#
|
|
|
|
FROM docker.io/gcc AS buildenv
|
|
COPY . 3proxy
|
|
RUN cd 3proxy &&\
|
|
export "LDFLAGS=-static" &&\
|
|
export "CFLAGS=-DNOPLUGINS -DNORADIUS -DNOIPV6 -DNOODBC -DNOCRYPT -DNOSTDRESOLVE" &&\
|
|
make -f Makefile.Linux PLUGINS= LIBS= &&\
|
|
strip bin/3proxy
|
|
|
|
FROM scratch
|
|
COPY --from=buildenv 3proxy/bin/3proxy /bin/3proxy
|
|
CMD ["/bin/3proxy"]
|