|
1 | | -FROM ubuntu:focal-20200319 |
| 1 | + |
| 2 | +FROM ubuntu:jammy-20220815 |
2 | 3 |
|
3 | 4 | ARG DEBIAN_FRONTEND=noninteractive |
4 | 5 |
|
5 | 6 | RUN apt-get update && apt-get install -y --no-install-recommends \ |
6 | 7 | arj \ |
7 | 8 | binutils \ |
8 | 9 | brotli \ |
| 10 | + build-essential \ |
| 11 | + ca-certificates \ |
| 12 | + clang \ |
9 | 13 | cpio \ |
| 14 | + curl \ |
10 | 15 | file \ |
| 16 | + git \ |
11 | 17 | gzip \ |
12 | 18 | lhasa \ |
| 19 | + libbz2-dev \ |
13 | 20 | libffi-dev \ |
| 21 | + liblzma-dev \ |
| 22 | + libncursesw5-dev \ |
| 23 | + libreadline-dev \ |
| 24 | + libsqlite3-dev \ |
| 25 | + libssl-dev \ |
| 26 | + libxml2-dev \ |
| 27 | + libxmlsec1-dev \ |
| 28 | + llvm \ |
14 | 29 | lrzip \ |
15 | 30 | lzip \ |
| 31 | + make \ |
16 | 32 | p7zip-full \ |
17 | | - python-pip-whl \ |
18 | | - python2.7 \ |
| 33 | + python3 \ |
| 34 | + python3-dev \ |
19 | 35 | python3-pip \ |
20 | | - python3.8 \ |
| 36 | + python3-venv \ |
| 37 | + sudo \ |
| 38 | + tk-dev \ |
21 | 39 | unrar \ |
22 | 40 | unzip \ |
23 | 41 | wget \ |
24 | 42 | xz-utils \ |
25 | 43 | zip \ |
| 44 | + zlib1g-dev \ |
26 | 45 | zstd \ |
27 | | - software-properties-common && \ |
28 | | - add-apt-repository ppa:deadsnakes/ppa && apt-get update && \ |
29 | | - bash -c "\ |
30 | | - apt-get install -y \ |
31 | | - python2.7{,-dev} \ |
32 | | - python3.6{,-dev} \ |
33 | | - python3.7{,-dev,-distutils} \ |
34 | | - python3.8{,-dev} \ |
35 | | - python3.9{,-dev,-distutils}\ |
36 | | - python3.10{,-dev,-distutils}\ |
37 | | - python3-distutils" \ |
38 | 46 | && rm -rf /var/lib/apt/lists/* |
39 | 47 |
|
40 | | -# create a user inside the container. if you specify your UID when building the |
41 | | -# image, you can mount directories into the container with read-write access: |
42 | | -# docker build -t "dtrx" -f Dockerfile --build-arg UID=$(id -u) . |
43 | | -ARG UID=1010 |
44 | | -ARG UNAME=builder |
45 | | -RUN useradd --uid ${UID} --create-home --user-group ${UNAME} && \ |
46 | | - echo "${UNAME}:${UNAME}" | chpasswd |
| 48 | +# pyenv |
| 49 | +RUN git clone --branch v2.3.4 https://github.com/pyenv/pyenv.git /pyenv |
| 50 | +ENV PYENV_ROOT /pyenv |
| 51 | +RUN /pyenv/bin/pyenv install 2.7.16 |
| 52 | +# openssl version on jammy (3) is too new for python 3.6, and breaks :/ |
| 53 | +# workaround is to use clang to build it |
| 54 | +# https://github.com/pyenv/pyenv/issues/2239#issuecomment-1079275184 |
| 55 | +RUN CC=clang /pyenv/bin/pyenv install 3.6.15 |
| 56 | +RUN /pyenv/bin/pyenv install 3.7.13 |
| 57 | +RUN /pyenv/bin/pyenv install 3.8.13 |
| 58 | +RUN /pyenv/bin/pyenv install 3.9.12 |
| 59 | +RUN /pyenv/bin/pyenv install 3.10.4 |
| 60 | + |
| 61 | +ENV PATH=/pyenv/bin:${PATH} |
47 | 62 |
|
48 | | -ENV PATH=${PATH}:/home/${UNAME}/.local/bin |
| 63 | +# Python requirements |
| 64 | +COPY requirements.txt /tmp/requirements.txt |
| 65 | +RUN pip3 install -r /tmp/requirements.txt |
49 | 66 |
|
50 | | -USER ${UNAME} |
| 67 | +COPY entrypoint.sh /entrypoint.sh |
| 68 | + |
| 69 | +ARG UID=1010 |
| 70 | +ARG USERNAME=builder |
| 71 | +RUN echo "root:root" | chpasswd \ |
| 72 | + && adduser --disabled-password --uid "${UID}" --gecos "" "${USERNAME}" \ |
| 73 | + && echo "${USERNAME}:${USERNAME}" | chpasswd \ |
| 74 | + && echo "%${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/${USERNAME} \ |
| 75 | + && chmod 0440 /etc/sudoers.d/${USERNAME} \ |
| 76 | + && adduser ${USERNAME} sudo |
51 | 77 |
|
52 | | -# Need tox to run the tests, docutils for rst2man.py |
53 | | -RUN pip3 install tox==3.15.2 docutils==0.16 pyyaml==5.4.1 |
| 78 | +# Ensure sudo group users are not |
| 79 | +# asked for a password when using |
| 80 | +# sudo command by ammending sudoers file |
| 81 | +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> \ |
| 82 | + /etc/sudoers |
54 | 83 |
|
55 | | -WORKDIR /workspace |
| 84 | +ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] |
0 commit comments