Skip to content

Instantly share code, notes, and snippets.

@szampardi
Last active January 29, 2023 22:30
Show Gist options
  • Save szampardi/e0dada4b1ec9682343f1754cebc52c75 to your computer and use it in GitHub Desktop.
Save szampardi/e0dada4b1ec9682343f1754cebc52c75 to your computer and use it in GitHub Desktop.
FROM alpine
RUN apk update; \
apk --no-cache upgrade; \
apk add --no-cache bash
SHELL ["/bin/bash", "-o", "pipefail", "-xec"]
RUN apk add --no-cache autoconf automake file gcc git libcap-static libcap-ng libcap-ng-dev libcap-ng-static libnsl-static libltdl-static libtool linux-headers lz4-dev lz4-static make musl-dev openssl1.1-compat-dev openssl1.1-compat-libs-static pkgconfig
WORKDIR /usr/local/src/openvpn
RUN git clone --branch=v2.5.8 --depth=1 https://github.com/OpenVPN/openvpn $(pwd)
RUN autoreconf -i -v -f; \
./configure --enable-static --enable-iproute2 --disable-shared --disable-plugins --disable-selinux-build --disable-tap --disable-lzo; \
make LIBS="-all-static"
RUN strip ./src/openvpn/openvpn; \
du -sh ./src/openvpn/openvpn; \
file ./src/openvpn/openvpn; \
LD_TRACE_LOADED_OBJECTS=1 ./src/openvpn/openvpn --version; \
mv ./src/openvpn/openvpn /sbin/openvpn
FROM alpine
COPY --from=0 /sbin/openvpn /sbin/openvpn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment