Skip to content

Commit

Permalink
try jammy and default python
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbo committed Feb 14, 2024
1 parent 1f9bfa9 commit 88d4f77
Showing 1 changed file with 2 additions and 42 deletions.
44 changes: 2 additions & 42 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax = docker/dockerfile:1.2
FROM ubuntu:20.04
FROM ubuntu:22.04

# Install general dependencies
RUN apt-get update \
Expand All @@ -10,50 +10,10 @@ RUN apt-get update \
autoconf automake libgdbm-dev libncurses5-dev \
libsqlite3-dev libtool libyaml-dev pkg-config libgmp-dev \
libpq-dev libxi6 libjpeg-dev libpng-dev libtiff-dev libgif-dev \
libwebp-dev wget \
libwebp-dev wget python3 \
# Ruby deps
gawk bison sqlite3

# Uses python3.11 by default
ENV PYTHON_VERSION 3.11.3
ENV PYTHON_PIP_VERSION 24.0
ENV PYTHON_SETUPTOOLS_VERSION 65.5.1
ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/dbf0c85f76fb6e1ab42aa672ffca6f0a675d9ee4/public/get-pip.py
ENV PYTHON_GET_PIP_SHA256 dfe9fd5c28dc98b5ac17979a953ea550cec37ae1b47a5116007395bfacff2ab9
ENV PATH /usr/local/bin:$PATH
ENV LANG C.UTF-8

RUN wget -O python.tgz "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz"; \
mkdir -p /usr/src/python; \
tar -xf python.tgz -C /usr/src/python; \
cd /usr/src/python/Python-${PYTHON_VERSION}; \
./configure --enable-optimizations; \
nproc="$(nproc)"; \
make -j "$nproc"; \
make install;

RUN ln /usr/local/bin/python3 /usr/local/bin/python && \
py_version=`python --version` && \
if [[ "$py_version" != "Python $PYTHON_VERSION" ]]; then exit 1; fi;

RUN set -eux; \
\
wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \
echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \
\
export PYTHONDONTWRITEBYTECODE=1; \
\
python3 get-pip.py \
--disable-pip-version-check \
--no-cache-dir \
--no-compile \
"pip==$PYTHON_PIP_VERSION" \
"setuptools==$PYTHON_SETUPTOOLS_VERSION" \
; \
rm -f get-pip.py; \
\
pip --version;

# Deps for container hardening
RUN ln -sf "/usr/share/zoneinfo/$SYSTEM_TIMEZONE" /etc/localtime
COPY docker/ua-attach-config.sh .
Expand Down

0 comments on commit 88d4f77

Please sign in to comment.