Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to build statically #76

Open
test-account-0 opened this issue Sep 4, 2019 · 0 comments
Open

option to build statically #76

test-account-0 opened this issue Sep 4, 2019 · 0 comments

Comments

@test-account-0
Copy link

test-account-0 commented Sep 4, 2019

this is very low priority feature request

now I'm building openvpn-auth-ldap with some tricks

FROM alpine as base
RUN apk add --no-cache openvpn openssl iptables bash

FROM base as build
RUN apk add --no-cache openvpn-dev autoconf re2c libtool \
                openldap-dev libressl-dev gcc-objc make git
RUN git clone https://github.com/OpenVPN/easy-rsa.git && \
        mv /easy-rsa/easyrsa3 /usr/share/easy-rsa
RUN git clone https://github.com/threerings/openvpn-auth-ldap
RUN cd /openvpn-auth-ldap && \
        ./regen.sh && \
        ./configure --with-openvpn=/usr/include/openvpn CFLAGS="-fPIC" OBJCFLAGS="-std=gnu11" && \
        make && \
        make install
RUN cd /tmp && \
        ldd /usr/local/lib/openvpn-auth-ldap.so | tr -s '[:blank:]' '\n' | grep '^/' | \
    xargs -I % sh -c 'mkdir -p $(dirname deps%); cp % deps%;'


FROM base as production
USER root
COPY --from=build /usr/local/lib/openvpn-auth-ldap.so /usr/local/lib/
COPY --from=build /usr/share/easy-rsa/ /usr/share/easy-rsa/
COPY --from=build /tmp/deps /

RUN mkdir -p /dev/net && \
        mknod /dev/net/tun c 10 200

would it be possible to build it statically?

I tried something like this as a result of some googling, but it resulted in error

make SHARED=0 CC='gcc -static' PLUGIN_LD='gcc -static'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant