From 352d729d52fa214ccca899202b3013ccfc627a61 Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Sat, 14 Dec 2019 23:15:16 -0800 Subject: Switch Docker base image to Debian Buster Unlike Alpine, Python manylinux wheels work on Debian because it's a glibc-based distro. --- docker/base.Dockerfile | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'docker') diff --git a/docker/base.Dockerfile b/docker/base.Dockerfile index 3c5d7de..03816fb 100644 --- a/docker/base.Dockerfile +++ b/docker/base.Dockerfile @@ -1,15 +1,16 @@ -FROM python:3.8.0-alpine3.10 as builder -RUN apk add --no-cache --update \ - bison~=3.3 \ - bsd-compat-headers~=0.7 \ - flex~=2.6 \ - g++~=8.3 \ - gcc~=8.3 \ - git~=2.22 \ - libnl3-dev~=3.4 \ - linux-headers~=4.19 \ - make~=4.2 \ - protobuf-dev~=3.6 +FROM python:3.8.0-slim-buster as builder +RUN apt-get -y update \ + && apt-get install -y \ + bison=2:3.3.* \ + flex=2.6.* \ + g++=4:8.3.* \ + gcc=4:8.3.* \ + git=1:2.20.* \ + libprotobuf-dev=3.6.* \ + libnl-route-3-dev=3.4.* \ + make=4.2.* \ + pkg-config=0.29-6 \ + protobuf-compiler=3.6.* RUN git clone \ -b '2.9' \ --single-branch \ @@ -18,12 +19,13 @@ RUN git clone \ WORKDIR /nsjail RUN make -FROM python:3.8.0-alpine3.10 +FROM python:3.8.0-slim-buster ENV PIP_NO_CACHE_DIR=false -RUN apk add --no-cache --update \ - libnl3~=3.4 \ - libstdc++~=8.3 \ - protobuf~=3.6 +RUN apt-get -y update \ + && apt-get install -y \ + libnl-route-3-200=3.4.* \ + libprotobuf17=3.6.* \ + && rm -rf /var/lib/apt/lists/* RUN pip install pipenv==2018.11.26 COPY --from=builder /nsjail/nsjail /usr/sbin/ RUN chmod +x /usr/sbin/nsjail -- cgit v1.2.3 From 6978091a2b459f1636dd442b91c772e99f5d8454 Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Sat, 14 Dec 2019 23:20:02 -0800 Subject: Add gcc to base container A C compiler is needed for some of the Python libraries to build because they don't have wheels >:( --- docker/base.Dockerfile | 1 + 1 file changed, 1 insertion(+) (limited to 'docker') diff --git a/docker/base.Dockerfile b/docker/base.Dockerfile index 03816fb..6a63b12 100644 --- a/docker/base.Dockerfile +++ b/docker/base.Dockerfile @@ -23,6 +23,7 @@ FROM python:3.8.0-slim-buster ENV PIP_NO_CACHE_DIR=false RUN apt-get -y update \ && apt-get install -y \ + gcc=4:8.3.* \ libnl-route-3-200=3.4.* \ libprotobuf17=3.6.* \ && rm -rf /var/lib/apt/lists/* -- cgit v1.2.3