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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
FROM ubuntu:jammy-20220815
ARG DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c", "-o", "pipefail"]
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
arj \
binutils \
brotli \
build-essential \
ca-certificates \
clang \
cpio \
curl \
file \
git \
gzip \
lhasa \
libbz2-dev \
libffi-dev \
liblzma-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
libxmlsec1-dev \
llvm \
lrzip \
lzip \
make \
p7zip-full \
python3 \
python3-dev \
python3-pip \
python3-venv \
rpm2cpio \
sudo \
tk-dev \
unrar \
unzip \
wget \
xz-utils \
zip \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*
# pyenv
RUN git clone --branch v2.3.6 https://github.com/pyenv/pyenv.git /pyenv
ENV PYENV_ROOT /pyenv
RUN /pyenv/bin/pyenv install 2.7.18
# openssl version on jammy (3) is too new for python 3.6, and breaks :/
# workaround is to use clang to build it
# https://github.com/pyenv/pyenv/issues/2239#issuecomment-1079275184
# hadolint ignore=DL3059
RUN CC=clang /pyenv/bin/pyenv install 3.6.15
# hadolint ignore=DL3059
RUN /pyenv/bin/pyenv install 3.7.15
# hadolint ignore=DL3059
RUN /pyenv/bin/pyenv install 3.8.15
# hadolint ignore=DL3059
RUN /pyenv/bin/pyenv install 3.9.15
# hadolint ignore=DL3059
RUN /pyenv/bin/pyenv install 3.10.8
# hadolint ignore=DL3059
RUN /pyenv/bin/pyenv install 3.11.0
ENV PATH=/pyenv/bin:${PATH}
# Python requirements
COPY requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
COPY entrypoint.sh /entrypoint.sh
ARG UID=1010
ARG USERNAME=builder
RUN echo "root:root" | chpasswd \
&& adduser --disabled-password --uid "${UID}" --gecos "" "${USERNAME}" \
&& echo "${USERNAME}:${USERNAME}" | chpasswd \
&& echo "%${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/${USERNAME} \
&& chmod 0440 /etc/sudoers.d/${USERNAME} \
&& adduser ${USERNAME} sudo
# Ensure sudo group users are not
# asked for a password when using
# sudo command by ammending sudoers file
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> \
/etc/sudoers
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
|