-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (42 loc) · 1 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (42 loc) · 1 KB
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
41
42
43
44
45
46
47
FROM ubuntu:latest
ARG USER_ID=1000
ARG USER_GROUP_ID=1000
ARG DEBIAN_FRONTEND=noninteractive
RUN \
apt update \
&& apt upgrade -y \
&& apt install -y \
python3-pip \
software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt upgrade -y \
&& apt install -y \
python3.10 \
python3.10-distutils \
python3.11 \
python3.11-distutils \
python3.12 \
python3.13 \
python3.13-dev \
python3.14 \
python3.14-dev \
tox \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
RUN \
for n in `cat /etc/passwd | awk -F: '$3 == "'${USER_ID}'" { print $1 }'`; do userdel -r $n; done \
&& for n in `cat /etc/group | awk -F: '$3 == "'${USER_GROUP_ID}'" { print $1 }'`; do groupdel $n; done
RUN groupadd \
--gid $USER_GROUP_ID \
--system testuser \
&& useradd \
--system \
--no-log-init \
--shell /bin/bash \
--home-dir /test \
--uid $USER_ID \
--gid testuser \
testuser
WORKDIR /test
USER testuser
CMD ["tox", "run", "--", "--with-custom-logging"]