Merge pull request #78 from dlorenc/staticsocat

This statically compiles socat so it actually works in our iso.
pull/79/head
Lucas Käldström 2016-05-14 21:29:27 +03:00
commit 00a39dd2b0
1 changed files with 18 additions and 2 deletions

View File

@ -2,7 +2,23 @@ FROM golang:1.6
RUN apt-get update && apt-get install libssl-dev -q -y
ENV SOCAT socat-2.0.0-b8
# Musl
ENV MUSL_VERSION 1.1.10
RUN wget http://www.musl-libc.org/releases/musl-${MUSL_VERSION}.tar.gz
RUN tar zxvf musl-${MUSL_VERSION}.tar.gz
RUN cd musl-${MUSL_VERSION} && ./configure && make -j4 && make install
# OpenSSL
ENV OPENSSL_VERSION 1.0.2h
RUN wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
RUN tar zxvf openssl-${OPENSSL_VERSION}.tar.gz
RUN cd openssl-${OPENSSL_VERSION} && CC='/usr/local/musl/bin/musl-gcc -static' ./Configure no-shared linux-x86_64 && make
ENV SOCAT socat-1.7.3.0
RUN wget http://www.dest-unreach.org/socat/download/$SOCAT.tar.gz
RUN tar -zvxf $SOCAT.tar.gz
RUN cd $SOCAT && ./configure --disable-readline && make && mv ./socat /go/
RUN cd $SOCAT && CC='/usr/local/musl/bin/musl-gcc -static' \
CFLAGS='-fPIC' \
CPPFLAGS='-I/build -I/build/openssl-1.0.2/include -DNETDB_INTERNAL=-1' \
LDFLAGS="-L/build/openssl-${OPENSSL_VERSION}" \
./configure && make -j4 && strip socat && mv ./socat /go/