File: Dockerfile

package info (click to toggle)
sslh 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,960 kB
  • sloc: ansic: 7,681; perl: 683; sh: 356; makefile: 136
file content (38 lines) | stat: -rw-r--r-- 836 bytes parent folder | download
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
ARG ALPINE_VERSION="latest"
ARG TARGET_ARCH="library"

FROM docker.io/${TARGET_ARCH}/alpine:${ALPINE_VERSION} AS build

WORKDIR /sslh

RUN apk add --no-cache \
        'gcc' \
        'libconfig-dev' \
        'make' \
        'musl-dev' \
        'pcre2-dev' \
        'perl' \
        ;

COPY . /sslh

RUN ./configure && make sslh-select && strip sslh-select

FROM docker.io/${TARGET_ARCH}/alpine:${ALPINE_VERSION}

COPY --from=build "/sslh/sslh-select" "/usr/local/bin/sslh"
RUN apk add --no-cache \
        'libconfig' \
        'pcre2' \
        'iptables' \
        'ip6tables' \
        'libcap' \
    && \
    adduser -s '/bin/sh' -S -D sslh && \
    setcap cap_net_bind_service,cap_net_raw+ep /usr/local/bin/sslh

COPY "./container-entrypoint.sh" "/init"
ENTRYPOINT [ "/init" ]

# required for updating iptables
USER root:root