aboutsummaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-02-22 21:37:47 -0800
committerGravatar MarkKoz <[email protected]>2020-02-22 21:37:47 -0800
commit782c5fc6c2e60e8e460f17d39cfad39cae7f30e0 (patch)
treef8f44bbd9e7115458a2a259668167853ab53fa93 /docker
parentTest lint only (diff)
parentMerge pull request #62 from python-discord/bug/ci/61/python-symlink-not-resol... (diff)
Merge remote-tracking branch 'origin/master' into research
Diffstat (limited to 'docker')
-rw-r--r--docker/base.Dockerfile47
-rw-r--r--docker/venv.Dockerfile15
2 files changed, 36 insertions, 26 deletions
diff --git a/docker/base.Dockerfile b/docker/base.Dockerfile
index 1edff49..bbd0110 100644
--- a/docker/base.Dockerfile
+++ b/docker/base.Dockerfile
@@ -1,27 +1,34 @@
-FROM alpine:3.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
-RUN git clone https://github.com/google/nsjail.git /nsjail \
- && cd /nsjail \
- && git checkout 0b1d5ac03932c140f08536ed72b4b58741e7d3cf
+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 \
+ --depth 1 \
+ https://github.com/google/nsjail.git /nsjail
WORKDIR /nsjail
RUN make
-FROM python:3.7.4-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 \
+ gcc=4:8.3.* \
+ 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
diff --git a/docker/venv.Dockerfile b/docker/venv.Dockerfile
index ae61cbb..fe5b10d 100644
--- a/docker/venv.Dockerfile
+++ b/docker/venv.Dockerfile
@@ -1,14 +1,17 @@
-FROM pythondiscord/snekbox-base:devel
+FROM pythondiscord/snekbox-base:latest
ARG DEV
ENV PIP_NO_CACHE_DIR=false \
PIPENV_DONT_USE_PYENV=1 \
PIPENV_HIDE_EMOJIS=1 \
- PIPENV_NOSPIN=1 \
- PIPENV_VENV_IN_PROJECT=1
-
-COPY Pipfile Pipfile.lock /snekbox/
+ PIPENV_NOSPIN=1
+COPY Pipfile Pipfile.lock snekbox.cfg /snekbox/
WORKDIR /snekbox
-RUN if [ -n "${DEV}" ]; pipenv sync --dev; then pipenv sync; fi
+RUN if [ -n "${DEV}" ]; \
+ then \
+ pipenv install --deploy --system --dev; \
+ else \
+ pipenv install --deploy --system; \
+ fi