Attempting to build Wireshark tools statically
FROM alpine:latest | |
MAINTAINER Adam Baxter <voltagex@voltagex.org> | |
#How many jobs to run - i.e. passed to -j | |
ARG JLEVEL=8 | |
RUN apk --update add git wget xz tar | |
RUN apk add gcc g++ | |
RUN apk add libc-dev make libtool autoconf automake | |
RUN apk add python pkgconfig bison flex patch coreutils file linux-headers | |
RUN mkdir /src | |
WORKDIR /src | |
RUN git clone --depth=1 https://github.com/wireshark/wireshark | |
RUN wget -O - https://ftp.gnome.org/pub/gnome/sources/glib/2.54/glib-2.54.0.tar.xz | tar Jxf - | |
RUN wget -O - https://sourceforge.net/projects/libpng/files/zlib/1.2.11/zlib-1.2.11.tar.gz/download | tar zxf - | |
RUN git clone --depth=1 https://github.com/libffi/libffi/ | |
RUN wget -O - http://ftpmirror.gnu.org/gettext/gettext-0.19.8.tar.xz | tar Jxf - | |
RUN wget -O - https://sourceforge.net/projects/pcre/files/pcre/8.41/pcre-8.41.tar.bz2/download | tar jxf - | |
RUN wget -O - https://mirrors.dotsrc.org/gnupg/libgcrypt/libgcrypt-1.8.1.tar.bz2 | tar jxf - | |
RUN wget -O - https://mirrors.dotsrc.org/gnupg/libgpg-error/libgpg-error-1.27.tar.bz2 | tar jxf - | |
RUN wget -O - https://github.com/the-tcpdump-group/libpcap/archive/libpcap-1.8.1.tar.gz | tar zxf - | |
ENV CFLAGS "-fPIC -static" | |
ENV CXXFLAGS "-static" | |
ENV LDFLAGS "-static" | |
WORKDIR /src/zlib-1.2.11 | |
RUN ./configure --static | |
RUN make -j$JLEVEL | |
RUN make install | |
RUN ld -static -lz --verbose | grep succeeded | |
WORKDIR /src/libffi | |
RUN ./autogen.sh | |
RUN ./configure --enable-static --disable-shared --disable-docs | |
RUN make -j$JLEVEL | |
RUN make install | |
RUN ld -static -lffi --verbose | grep succeeded | |
WORKDIR /src/gettext-0.19.8 | |
RUN ./configure --enable-static --disable-shared --disable-dependency-tracking --disable-java | |
RUN make -j$JLEVEL | |
RUN make install | |
WORKDIR /src/pcre-8.41 | |
RUN ./configure --enable-static --disable-shared --disable-dependency-tracking --enable-utf8 --enable-unicode-properties | |
RUN make -j$JLEVEL | |
RUN make install | |
RUN ld -static -lpcre --verbose | grep succeeded | |
WORKDIR /src/glib-2.54.0 | |
RUN ./configure --disable-libmount --enable-static --disable-shared | |
RUN make -j$JLEVEL | |
RUN make install | |
#RUN ld -static -lgthread --verbose | |
WORKDIR /src/libgpg-error-1.27 | |
RUN ./configure --enable-static --disable-shared --disable-dependency-tracking | |
RUN make -j$JLEVEL | |
RUN make install | |
WORKDIR /src/libgcrypt-1.8.1 | |
RUN ./configure --enable-static --disable-shared --disable-dependency-tracking | |
RUN make -j$JLEVEL | |
RUN make install | |
WORKDIR /src/libpcap-libpcap-1.8.1/ | |
RUN ./configure --enable-static --disable-shared | |
RUN make -j$JLEVEL | |
RUN make install | |
ENV CC "gcc -static --static" | |
ENV CXX "g++ -static --static" | |
WORKDIR /src/wireshark | |
RUN ./autogen.sh | |
RUN ./configure --disable-wireshark --without-plugins --enable-static --disable-shared --without-extcap | |
RUN make -j$JLEVEL | |
RUN make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment