sslh/Dockerfile
Olliver Schinagl 9dd560493a
container: Drop privileges
A container is best served with the least amount of privileges. This
also ensures we don't have to drop anything later.

This does require running the container with elevated capabilities.

Note, that if for whatever reason, 'root' access within the container is
needed, this can easily be accomplished by running the container with
`docker run --user root:root sslh` for example.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2023-06-05 22:50:06 +02:00

27 lines
412 B
Docker

FROM alpine:latest as build
WORKDIR /sslh
COPY . /sslh
RUN \
apk add \
gcc \
libconfig-dev \
make \
musl-dev \
pcre2-dev \
perl && \
make sslh-select && \
strip sslh-select
FROM alpine:latest
COPY --from=build "/sslh/sslh-select" "/usr/local/bin/sslh"
RUN apk --no-cache add libconfig pcre2
COPY "./container-entrypoint.sh" "/init"
ENTRYPOINT [ "/init" ]
USER nobody:nogroup