* FIX [docker] fix failure to  build zeromq.
@@ -3,22 +3,23 @@ FROM gcc:10 as builder
COPY . /nanomq
COPY deploy/docker/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
-RUN apt update
-RUN apt install -y cmake ninja-build libmbedtls-dev libtool pkg-config build-essential autoconf automake
-
-WORKDIR /opt/zeromq
-
-RUN wget https://github.com/zeromq/libzmq/releases/download/v4.3.4/zeromq-4.3.4.tar.gz
-RUN tar zxvf zeromq-4.3.4.tar.gz
-RUN cd zeromq-4.3.4
-RUN mkdir build
-RUN cd build
-RUN cmake -G Ninja -DWITH_PERF_TOOL=OFF \
+RUN apt update \
+ && apt install -y cmake ninja-build libmbedtls-dev libtool pkg-config build-essential autoconf automake \
+ && rm -rf /var/lib/apt/lists/*
+
+WORKDIR /tmp/zeromq
+
+RUN wget https://github.com/zeromq/libzmq/releases/download/v4.3.4/zeromq-4.3.4.tar.gz \
+ && tar zxf zeromq-4.3.4.tar.gz \
+ && cd zeromq-4.3.4 \
+ && mkdir build \
+ && cd build \
+ && cmake -G Ninja -DWITH_PERF_TOOL=OFF \
-DZMQ_BUILD_TESTS=OFF \
-DENABLE_CPACK=OFF \
- -DCMAKE_BUILD_TYPE=Release ..
-RUN ninja install
-RUN ldconfig
+ -DCMAKE_BUILD_TYPE=Release .. \
+ && ninja install \
+ && ldconfig
WORKDIR /nanomq/build
