-
Notifications
You must be signed in to change notification settings - Fork 0
/
py310-debian.dockerfile
40 lines (34 loc) · 1.06 KB
/
py310-debian.dockerfile
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
#
# Development Dockerfile, featuring:
# - Debian development environment
#
# Build with:
#
# $ docker build -f py310-debian.dockerfile .
#
FROM docker.io/library/python:3.10 as baseimage
ARG FLAVOR=debian
ARG PIP_ARGS="--no-cache-dir --prefer-binary"
RUN apt-get update && \
apt-get install -y libgl-dev libgl1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /tools
RUN pip3 install --upgrade pip
COPY ./requirements.${FLAVOR}.txt ./requirements-dev.txt /tools/
RUN --mount=type=cache,target=/wheels \
pip wheel -w /wheels ${PIP_ARGS} \
-r /tools/requirements.${FLAVOR}.txt \
-r /tools/requirements-dev.txt
RUN --mount=type=cache,target=/wheels \
pip install --find-links /wheels --no-index ${PIP_ARGS} \
-r /tools/requirements.${FLAVOR}.txt \
-r /tools/requirements-dev.txt
RUN --mount=type=cache,target=/wheels cp -r /wheels /tools/wheels
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
EXPOSE 8080
VOLUME [ "/home/jupyter" ]
WORKDIR /home/jupyter
RUN useradd -u 1000 -s /bin/bash -g 0 jupyter
USER 1000