mirror of
https://github.com/yrutschle/sslh.git
synced 2026-10-22 10:02:09 +03:00
build sslh with libproxyprotocol
This commit is contained in:
1 parent
c29081f71d
commit
86188cdd28
1 file changed
+26
-3
+26
-3
@@ -3,8 +3,7 @@ ARG TARGET_ARCH="library"
|
|||||||
|
|
||||||
FROM docker.io/${TARGET_ARCH}/alpine:${ALPINE_VERSION} AS build
|
FROM docker.io/${TARGET_ARCH}/alpine:${ALPINE_VERSION} AS build
|
||||||
|
|
||||||
WORKDIR /sslh
|
# Install build dependencies for sslh and libproxyprotocol
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
'gcc' \
|
'gcc' \
|
||||||
'libconfig-dev' \
|
'libconfig-dev' \
|
||||||
@@ -12,15 +11,39 @@ RUN apk add --no-cache \
|
|||||||
'musl-dev' \
|
'musl-dev' \
|
||||||
'pcre2-dev' \
|
'pcre2-dev' \
|
||||||
'perl' \
|
'perl' \
|
||||||
|
'git' \
|
||||||
|
'autoconf' \
|
||||||
|
'automake' \
|
||||||
|
'libtool' \
|
||||||
;
|
;
|
||||||
|
|
||||||
|
# Build libproxyprotocol
|
||||||
|
WORKDIR /tmp
|
||||||
|
RUN git clone https://github.com/kosmas-valianos/libproxyprotocol.git && \
|
||||||
|
cd libproxyprotocol && \
|
||||||
|
make && \
|
||||||
|
mkdir -p /usr/local/include/ && \
|
||||||
|
mv libs/libproxyprotocol.so /usr/local/lib/ && \
|
||||||
|
mv src/* /usr/local/include/
|
||||||
|
|
||||||
|
# Set environment variables for sslh to find libproxyprotocol
|
||||||
|
ENV C_INCLUDE_PATH=/usr/local/include
|
||||||
|
ENV LIBRARY_PATH=/usr/local/lib
|
||||||
|
ENV LD_LIBRARY_PATH=/usr/local/lib
|
||||||
|
|
||||||
|
WORKDIR /sslh
|
||||||
COPY . /sslh
|
COPY . /sslh
|
||||||
|
|
||||||
|
# Configure and build sslh
|
||||||
|
# The configure script should automatically detect libproxyprotocol
|
||||||
RUN ./configure && make sslh-select && strip sslh-select
|
RUN ./configure && make sslh-select && strip sslh-select
|
||||||
|
|
||||||
FROM docker.io/${TARGET_ARCH}/alpine:${ALPINE_VERSION}
|
FROM docker.io/${TARGET_ARCH}/alpine:${ALPINE_VERSION}
|
||||||
|
|
||||||
|
# Copy libproxyprotocol.so from the build stage
|
||||||
|
COPY --from=build /usr/local/lib/libproxyprotocol.so* /usr/local/lib/
|
||||||
COPY --from=build "/sslh/sslh-select" "/usr/local/bin/sslh"
|
COPY --from=build "/sslh/sslh-select" "/usr/local/bin/sslh"
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
'libconfig' \
|
'libconfig' \
|
||||||
'pcre2' \
|
'pcre2' \
|
||||||
@@ -35,4 +58,4 @@ COPY "./container-entrypoint.sh" "/init"
|
|||||||
ENTRYPOINT [ "/init" ]
|
ENTRYPOINT [ "/init" ]
|
||||||
|
|
||||||
# required for updating iptables
|
# required for updating iptables
|
||||||
USER root:root
|
USER root:root
|
||||||
Reference in new issue
Block a user