1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
FROM calid/perl-zmq-base:ubuntu as base
ENV DEBIAN_FRONTEND=noninteractive
ENV PREFIX=/root/.zmq-ffi/usr
RUN apt-get update \
&& apt-get install -y git g++ autoconf automake libtool-bin pkg-config \
uuid-dev tzdata locales \
&& locale-gen fr_FR.utf8 && update-locale \
&& apt-get clean
WORKDIR /root/.zmq-ffi
RUN git clone https://github.com/zeromq/zeromq2-x.git \
&& cd zeromq2-x \
&& ./autogen.sh \
&& ./configure --prefix=$PREFIX/zeromq2-x --disable-static \
&& make install \
&& strip --strip-unneeded $PREFIX/zeromq2-x/lib/libzmq.so \
&& git clean -dfx && git gc --aggressive --prune
RUN git clone https://github.com/zeromq/zeromq3-x.git \
&& cd zeromq3-x \
&& ./autogen.sh \
&& ./configure --prefix=$PREFIX/zeromq3-x --disable-static \
&& make install \
&& strip --strip-unneeded $PREFIX/zeromq3-x/lib/libzmq.so \
&& git clean -dfx && git gc --aggressive --prune
RUN git clone https://github.com/zeromq/zeromq4-1.git \
&& cd zeromq4-1 \
&& ./autogen.sh \
&& ./configure --prefix=$PREFIX/zeromq4-1 --disable-static \
&& make install \
&& strip --strip-unneeded $PREFIX/zeromq4-1/lib/libzmq.so \
&& git clean -dfx && git gc --aggressive --prune
RUN git clone https://github.com/zeromq/zeromq4-x.git \
&& cd zeromq4-x \
&& ./autogen.sh \
&& ./configure --prefix=$PREFIX/zeromq4-x --disable-static \
&& make install \
&& strip --strip-unneeded $PREFIX/zeromq4-x/lib/libzmq.so \
&& git clean -dfx && git gc --aggressive --prune
RUN git clone https://github.com/zeromq/libzmq.git \
&& cd libzmq \
&& ./autogen.sh \
&& ./configure --prefix=$PREFIX/libzmq --disable-static \
&& make install \
&& strip --strip-unneeded $PREFIX/libzmq/lib/libzmq.so \
&& git clean -dfx && git gc --aggressive --prune
FROM base as zmq-base
COPY scripts/print_zmq_msg_size.c zmq_msg_size/
RUN cd zmq_msg_size \
&& \
gcc -I$PREFIX/zeromq2-x/include print_zmq_msg_size.c \
-o print_zeromq2-x_msg_size \
-Wl,-rpath=$PREFIX/zeromq2-x/lib -L$PREFIX/zeromq2-x/lib -lzmq \
&& ./print_zeromq2-x_msg_size >> zmq_msg_sizes \
&& \
gcc -I$PREFIX/zeromq3-x/include print_zmq_msg_size.c \
-o print_zeromq3-x_msg_size \
-Wl,-rpath=$PREFIX/zeromq3-x/lib -L$PREFIX/zeromq3-x/lib -lzmq \
&& ./print_zeromq3-x_msg_size >> zmq_msg_sizes \
&& \
gcc -I$PREFIX/zeromq4-1/include print_zmq_msg_size.c \
-o print_zeromq4-1_msg_size \
-Wl,-rpath=$PREFIX/zeromq4-1/lib -L$PREFIX/zeromq4-1/lib -lzmq \
&& ./print_zeromq4-1_msg_size >> zmq_msg_sizes \
&& \
gcc -I$PREFIX/zeromq4-x/include print_zmq_msg_size.c \
-o print_zeromq4-x_msg_size \
-Wl,-rpath=$PREFIX/zeromq4-x/lib -L$PREFIX/zeromq4-x/lib -lzmq \
&& ./print_zeromq4-x_msg_size >> zmq_msg_sizes \
&& \
gcc -I$PREFIX/libzmq/include print_zmq_msg_size.c \
-o print_libzmq_msg_size \
-Wl,-rpath=$PREFIX/libzmq/lib -L$PREFIX/libzmq/lib -lzmq \
&& ./print_libzmq_msg_size >> zmq_msg_sizes
FROM zmq-base as dzil-base
RUN apt-get install -y libdist-zilla-perl libterm-ui-perl libanyevent-perl \
&& apt-get clean
FROM dzil-base as zmq-ffi-base
COPY . /zmq-ffi/
RUN cd /zmq-ffi && dzil authordeps --missing | cpanm -v
RUN cd /zmq-ffi && dzil listdeps --missing | cpanm -v && cpanm -v Sys::SigAction
RUN apt-get -y purge gcc g++ autoconf automake libtool-bin pkg-config \
libssl-dev zlib1g-dev uuid-dev \
&& apt -y autoremove \
&& rm -r /var/lib/apt/lists/* ~/.cpanm /zmq-ffi /usr/local/share/man/* \
/usr/share/doc/*
FROM scratch
COPY --from=zmq-ffi-base / /
|