Skip to content

Commit

Permalink
Update the base image to Ubuntu 22.04 (#37)
Browse files Browse the repository at this point in the history
Other updates included:

* Upgrade from PowerShell 7.3.8 to 7.4.0 (includes .NET 8.0.0)
* Clean up and better document the container build
* Omit `pip` from `/usr/bin` (it's still in `/usr/local/bin`)
  • Loading branch information
mattclay authored Jan 3, 2024
1 parent 3313989 commit 1c1bd28
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
43 changes: 19 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
FROM quay.io/bedrock/ubuntu:focal-20230801
FROM quay.io/bedrock/ubuntu:jammy-20231211.1

# Prevent automatic apt cache cleanup, as caching is desired when running integration tests.
# Instead, when installing packages during container builds, explicit cache cleanup is required.
RUN rm /etc/apt/apt.conf.d/docker-clean

RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
Expand All @@ -20,19 +24,22 @@ RUN apt-get update -y && \
openssh-client \
openssh-server \
openssl \
python3.8-dev \
python3.8-distutils \
python3.8-venv \
python3.9-dev \
python3.9-distutils \
python3.9-venv \
python-is-python3 \
python3.10-dev \
python3.10-venv \
python3.11-dev \
python3.11-venv \
shellcheck \
sudo \
systemd-sysv \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Perform locale generation now that the locales package is installed.
RUN locale-gen en_US.UTF-8

# Enable the deadsnakes PPA to provide additional packages.
COPY files/deadsnakes.gpg /etc/apt/keyrings/deadsnakes.gpg
COPY files/deadsnakes.list /etc/apt/sources.list.d/deadsnakes.list

Expand All @@ -41,28 +48,20 @@ COPY files/deadsnakes.list /etc/apt/sources.list.d/deadsnakes.list
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.7-dev \
python3.7-distutils \
python3.7-venv \
python3.10-dev \
python3.10-distutils \
python3.10-venv \
python3.11-dev \
python3.11-distutils \
python3.11-venv \
python3.8-dev \
python3.8-venv \
python3.9-dev \
python3.9-venv \
python3.12-dev \
python3.12-distutils \
python3.12-venv \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN rm /etc/apt/apt.conf.d/docker-clean && \
ln -s python3 /usr/bin/python && \
locale-gen en_US.UTF-8

# Install PowerShell using a binary archive.
# This allows pinning to a specific version, and also brings support for multiple architectures.
RUN version="7.3.8" && \
RUN version="7.4.0" && \
major_version="$(echo ${version} | cut -f 1 -d .)" && \
install_dir="/opt/microsoft/powershell/${major_version}" && \
tmp_file="/tmp/powershell.tgz" && \
Expand All @@ -88,7 +87,3 @@ CMD ["/sbin/init"]
COPY files/*.py /usr/share/container-setup/
RUN ln -s /usr/bin/python3.12 /usr/share/container-setup/python
RUN /usr/share/container-setup/python -B /usr/share/container-setup/setup.py

# Make sure the pip entry points in /usr/bin are correct.
RUN rm -f /usr/bin/pip3 && cp -av /usr/local/bin/pip3 /usr/bin/pip3 && /usr/bin/pip3 -V && \
rm -f /usr/bin/pip && cp -av /usr/local/bin/pip /usr/bin/pip && /usr/bin/pip -V
4 changes: 2 additions & 2 deletions files/deadsnakes.list
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
deb [signed-by=/etc/apt/keyrings/deadsnakes.gpg] http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal main
deb-src [signed-by=/etc/apt/keyrings/deadsnakes.gpg] http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal main
deb [signed-by=/etc/apt/keyrings/deadsnakes.gpg] http://ppa.launchpad.net/deadsnakes/ppa/ubuntu jammy main
deb-src [signed-by=/etc/apt/keyrings/deadsnakes.gpg] http://ppa.launchpad.net/deadsnakes/ppa/ubuntu jammy main

0 comments on commit 1c1bd28

Please sign in to comment.