-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(docker): upgrade to Ubuntu 24.04 LTS and Python 3.12 (#143)
- Loading branch information
1 parent
bfd637c
commit 30f3bda
Showing
2 changed files
with
58 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters