Skip to content

Commit

Permalink
build(docker): upgrade to Ubuntu 24.04 LTS and Python 3.12 (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiborsimko committed Aug 22, 2024
1 parent bfd637c commit 30f3bda
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 36 deletions.
93 changes: 58 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,52 @@
# This file is part of cernopendata-client.
#
# Copyright (C) 2020, 2022, 2023 CERN.
# Copyright (C) 2020, 2022, 2023, 2024 CERN.
#
# cernopendata-client is free software; you can redistribute it and/or modify
# it under the terms of the GPLv3 license; see LICENSE file for more details.

# Use Fedora 38
FROM registry.fedoraproject.org/fedora:38
# Use Ubuntu LTS base image
FROM docker.io/library/ubuntu:24.04

# Use default answers in installation commands
ENV DEBIAN_FRONTEND=noninteractive

# Allow pip to install packages in the system site-packages dir
ENV PIP_BREAK_SYSTEM_PACKAGES=true

# Install prerequisites
# hadolint ignore=DL3033,DL3041
RUN dnf install -y \
black \
ca-certificates \
check-manifest \
curl \
python3-certifi \
python3-click \
python3-coverage \
python3-docutils \
python3-jinja2 \
python3-mock \
python3-pbr \
python3-pip \
python3-pycurl \
python3-pydocstyle \
python3-pytest \
python3-pytest-cache \
python3-pytest-cov \
python3-pytest-mock \
python3-requests \
python3-urllib3 \
python3-wheel \
python3-xrootd \
xrootd-client && \
dnf autoremove -y && \
dnf clean all && \
# hadolint ignore=DL3008,DL3013
RUN apt-get update -y && \
apt-get install --no-install-recommends -y \
black \
ca-certificates \
check-manifest \
curl \
libpython3.12 \
python3-pip \
python3.12 \
python3.12-dev \
python3-certifi \
python3-click \
python3-coverage \
python3-docutils \
python3-execnet \
python3-jinja2 \
python3-mock \
python3-pbr \
python3-pip \
python3-pycurl \
python3-pydocstyle \
python3-pytest \
python3-pytest-cov \
python3-pytest-mock \
python3-requests \
python3-urllib3 \
python3-wheel \
python3-xrootd \
xrootd-client && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Add sources to `/code` and work there
Expand All @@ -47,12 +58,24 @@ COPY . /code
RUN pip3 install --no-cache-dir '.[pycurl,tests,xrootd]' && \
rm -rf /code

# Run container as `cernopendata` user with UID `1000`, which should match
# Run container as `ubuntu` user with UID `1000`, which should match
# current host user in most situations
# hadolint ignore=DL3059
RUN adduser --uid 1000 cernopendata --gid 0 && \
chown -R cernopendata:root /code
RUN chown -R ubuntu /code
USER ubuntu

# Run cernopendata-client upon entry
USER cernopendata
ENTRYPOINT ["cernopendata-client"]

# Set image labels
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.created="2024-08-22"
LABEL org.opencontainers.image.description="CERN Open Data - command-line client"
LABEL org.opencontainers.image.documentation="https://cernopendata-client.readthedocs.io/"
LABEL org.opencontainers.image.licenses="GPLv3"
LABEL org.opencontainers.image.source="https://github.com/cernopendata/cernopendata-client"
LABEL org.opencontainers.image.title="cernopendata-client"
LABEL org.opencontainers.image.url="https://github.com/cernopendata/cernopendata-client"
LABEL org.opencontainers.image.vendor="cernopendata"
# x-release-please-start-version
LABEL org.opencontainers.image.version="0.4.0"
# x-release-please-end
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"coverage>=4.0",
"mock>=3.0",
"pydocstyle>=1.0.0",
"pytest-cache>=1.0",
"pytest-cov>=1.8.0",
"pytest>=2.8.0",
'platformdirs<2.1 ; python_version=="3.6"',
Expand Down

0 comments on commit 30f3bda

Please sign in to comment.