Dockerfile 1.7 KB

12345678910111213141516171819202122232425262728293031
  1. ARG DOCKER_BASE_IMAGE=ubuntu:22.04
  2. FROM $DOCKER_BASE_IMAGE
  3. USER root
  4. ARG DEPS_WOLFSSL="build-essential autoconf libtool clang clang-tools zlib1g-dev libuv1-dev libpam0g-dev valgrind git linux-headers-generic gcc-multilib g++-multilib libpcap-dev bubblewrap gdb iputils-ping lldb bsdmainutils netcat binutils-arm-linux-gnueabi binutils-aarch64-linux-gnu"
  5. ARG DEPS_LIBOQS="astyle cmake gcc ninja-build libssl-dev python3-pytest python3-pytest-xdist unzip xsltproc doxygen graphviz python3-yaml valgrind git"
  6. ARG DEPS_TESTS="abi-dumper libcurl4-openssl-dev tcpdump"
  7. RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y apt-utils \
  8. && apt install -y ${DEPS_WOLFSSL} ${DEPS_LIBOQS} ${DEPS_TESTS} \
  9. && apt clean -y && rm -rf /var/lib/apt/lists/*
  10. ARG USER=docker
  11. ARG UID=1000
  12. ARG GID=1000
  13. RUN groupadd -f -g ${GID} docker && ( getent passwd ${UID} || useradd -ms /bin/bash ${USER} -u ${UID} -g ${GID} )
  14. # install liboqs
  15. RUN git clone --single-branch https://github.com/open-quantum-safe/liboqs.git && cd liboqs && git checkout db08f12b5a96aa6582a82aac7f65cf8a4d8b231f \
  16. && mkdir build && cd build && cmake -DOQS_DIST_BUILD=ON -DOQS_USE_CPUFEATURE_INSTRUCTIONS=OFF -DOQS_USE_OPENSSL=0 .. && make -j8 all && make install && cd ../.. && rm -rf liboqs
  17. RUN mkdir /opt/sources
  18. # install liblms
  19. RUN cd /opt/sources && git clone --single-branch https://github.com/cisco/hash-sigs.git && cd hash-sigs && git checkout b0631b8891295bf2929e68761205337b7c031726 \
  20. && sed -i 's/USE_OPENSSL 1/USE_OPENSSL 0/g' sha256.h && make -j4 hss_lib_thread.a
  21. # Allow non-root to use tcpdump (will need NET_RAW and NET_ADMIN capability when running the container)
  22. RUN setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/tcpdump
  23. USER ${UID}:${GID}