Skip to content

Commit

Permalink
Do not install Python distro packages that are also installed through…
Browse files Browse the repository at this point in the history
… requirements.txt:

Also
- virtualenv is not venv and not needed (but Ubuntu needs python-venv);
- split RUN lines
- move ADD lines early: these files rarely change
- remove commented lines
- use venv throughout all (current) distros.
  • Loading branch information
Axel-Naumann committed Oct 25, 2023
1 parent 7a4b0fb commit 436169b
Show file tree
Hide file tree
Showing 20 changed files with 76 additions and 192 deletions.
21 changes: 9 additions & 12 deletions alma8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
FROM gitlab-registry.cern.ch/linuxsupport/alma8-base

COPY packages.txt packages.txt
ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN dnf update -q -y \
RUN dnf update -y \
&& dnf install -y epel-release \
&& dnf install -y --setopt=install_weak_deps=False $(cat packages.txt) \
&& dnf autoremove \
&& dnf clean all \
&& rm -f packages.txt \
&& curl -O -L https://github.com/Kitware/CMake/releases/download/v3.26.2/cmake-3.26.2-linux-x86_64.sh \
&& sh ./cmake-*.sh --skip-license --prefix=/usr/local/ \
&& rm ./cmake-*.sh


ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt
&& dnf clean all \
&& rm -rf /var/cache/dnf

RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install -r requirements-root.txt -r requirements-roottest.txt 'openstacksdk<=1.2.0' \
RUN mkdir -p /py-venv \
&& python3 -m venv /py-venv/ROOT-CI \
&& /py-venv/ROOT-CI/bin/pip install --upgrade pip \
&& /py-venv/ROOT-CI/bin/pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
&& rm -f requirements-root.txt requirements-roottest.txt
3 changes: 0 additions & 3 deletions alma8/packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ protobuf-devel
pythia8-devel
python3
python3-devel
python3-numpy
python3-pip
python3-virtualenv
qt5-qtwebengine-devel
R-devel
R-Rcpp-devel
Expand Down
21 changes: 9 additions & 12 deletions alma9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
FROM gitlab-registry.cern.ch/linuxsupport/alma9-base

COPY packages.txt packages.txt
ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN dnf update -q -y \
RUN dnf update -y \
&& dnf install -y epel-release \
&& dnf install -y --setopt=install_weak_deps=False $(cat packages.txt) \
&& dnf autoremove \
&& dnf clean all \
&& rm -f packages.txt \
&& curl -O -L https://github.com/Kitware/CMake/releases/download/v3.26.2/cmake-3.26.2-linux-x86_64.sh \
&& sh ./cmake-*.sh --skip-license --prefix=/usr/local/ \
&& rm ./cmake-*.sh


ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt
&& dnf clean all \
&& rm -rf /var/cache/dnf

RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install -r requirements-root.txt -r requirements-roottest.txt 'openstacksdk<=1.2.0' \
RUN mkdir -p /py-venv \
&& python3 -m venv /py-venv/ROOT-CI \
&& /py-venv/ROOT-CI/bin/pip install --upgrade pip \
&& /py-venv/ROOT-CI/bin/pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
&& rm -f requirements-root.txt requirements-roottest.txt
3 changes: 0 additions & 3 deletions alma9/packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ protobuf-devel
pythia8-devel
python3
python3-devel
python3-numpy
python3-pip
python3-virtualenv
qt5-qtwebengine-devel
R-devel
R-Rcpp-devel
Expand Down
21 changes: 8 additions & 13 deletions fedora37-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@

FROM fedora:37

# RUN useradd -s /bin/bash sftnight

RUN dnf update -y \
&& dnf clean all \
&& rm -rf /var/cache/dnf

COPY packages.txt packages.txt
ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN dnf install $(cat packages.txt) -y --setopt=install_weak_deps=False \
RUN dnf update -y \
&& dnf install $(cat packages.txt) -y --setopt=install_weak_deps=False \
&& rm -f packages.txt \
&& dnf clean all \
&& rm -rf /var/cache/dnf

ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
RUN mkdir -p /py-venv \
&& python3 -m venv /py-venv/ROOT-CI \
&& /py-venv/ROOT-CI/bin/pip install --upgrade pip \
&& /py-venv/ROOT-CI/bin/pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
&& rm -f requirements-root.txt requirements-roottest.txt
4 changes: 0 additions & 4 deletions fedora37-test/packages.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

avahi-compat-libdns_sd-devel
avahi-devel
binutils
Expand Down Expand Up @@ -47,9 +46,6 @@ protobuf-devel
pythia8-devel
python3
python3-devel
python3-numpy
python3-pip
python3-virtualenv
qt5-qtwebengine-devel
R-devel
R-Rcpp-devel
Expand Down
21 changes: 8 additions & 13 deletions fedora37/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@

FROM fedora:37

# RUN useradd -s /bin/bash sftnight

RUN dnf update -y \
&& dnf clean all \
&& rm -rf /var/cache/dnf

COPY packages.txt packages.txt
ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN dnf install $(cat packages.txt) -y --setopt=install_weak_deps=False \
RUN dnf update -y \
&& dnf install -y --setopt=install_weak_deps=False $(cat packages.txt) \
&& rm -f packages.txt \
&& dnf clean all \
&& rm -rf /var/cache/dnf

ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
RUN mkdir -p /py-venv \
&& python3 -m venv /py-venv/ROOT-CI \
&& /py-venv/ROOT-CI/bin/pip install --upgrade pip \
&& /py-venv/ROOT-CI/bin/pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
&& rm -f requirements-root.txt requirements-roottest.txt
5 changes: 0 additions & 5 deletions fedora37/packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ protobuf-devel
pythia8-devel
python3
python3-devel
python3-devel
python3-numpy
python3-numpy
python3-pip
python3-virtualenv
qt5-qtwebengine-devel
R-devel
R-Rcpp-devel
Expand Down
20 changes: 8 additions & 12 deletions fedora38/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
FROM fedora:38

# RUN useradd -s /bin/bash sftnight

RUN dnf update -y \
&& dnf clean all \
&& rm -rf /var/cache/dnf

COPY packages.txt packages.txt
ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN dnf install $(cat packages.txt) -y --setopt=install_weak_deps=False \
RUN dnf update -y \
&& dnf install -y --setopt=install_weak_deps=False $(cat packages.txt) \
&& rm -f packages.txt \
&& dnf clean all \
&& rm -rf /var/cache/dnf

ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
RUN mkdir -p /py-venv \
&& python3 -m venv /py-venv/ROOT-CI \
&& /py-venv/ROOT-CI/bin/pip install --upgrade pip \
&& /py-venv/ROOT-CI/bin/pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
&& rm -f requirements-root.txt requirements-roottest.txt
5 changes: 0 additions & 5 deletions fedora38/packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ protobuf-devel
pythia8-devel
python3
python3-devel
python3-devel
python3-numpy
python3-numpy
python3-pip
python3-virtualenv
qt5-qtwebengine-devel
R-devel
R-Rcpp-devel
Expand Down
18 changes: 7 additions & 11 deletions fedora39/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
FROM fedora:39

# RUN useradd -s /bin/bash sftnight

RUN dnf update -y \
&& dnf clean all \
&& rm -rf /var/cache/dnf

COPY packages.txt packages.txt
ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN dnf install $(cat packages.txt) -y --setopt=install_weak_deps=False \
RUN dnf update -y \
&& dnf install -y --setopt=install_weak_deps=False $(cat packages.txt) \
&& rm -f packages.txt \
&& dnf clean all \
&& rm -rf /var/cache/dnf

ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN mkdir -p /py-venv && python3 -m venv /py-venv/ROOT-CI && /py-venv/ROOT-CI/bin/pip install --upgrade pip \
RUN mkdir -p /py-venv \
&& python3 -m venv /py-venv/ROOT-CI \
&& /py-venv/ROOT-CI/bin/pip install --upgrade pip \
&& /py-venv/ROOT-CI/bin/pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
&& rm -f requirements-root.txt requirements-roottest.txt

Expand Down
5 changes: 0 additions & 5 deletions fedora39/packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ protobuf-devel
pythia8-devel
python3
python3-devel
python3-devel
python3-numpy
python3-numpy
python3-pip
python3-virtualenv
qt5-qtwebengine-devel
R-devel
R-Rcpp-devel
Expand Down
30 changes: 8 additions & 22 deletions ubuntu20/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM ubuntu:20.04

# RUN useradd -s /bin/bash sftnight

ENV LANG=C.UTF-8


COPY packages.txt packages.txt
ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN apt-get update -qq \
&& ln -sf /usr/share/zoneinfo/UTC /etc/localtime \
Expand All @@ -14,25 +13,12 @@ RUN apt-get update -qq \
&& apt-get clean -y \
&& rm -rf /var/cache/apt/archives/* \
&& rm -rf /var/lib/apt/lists/* \
&& rm packages.txt \
&& update-ca-certificates \
&& curl -O -L https://github.com/Kitware/CMake/releases/download/v3.26.2/cmake-3.26.2-linux-x86_64.sh \
&& sh ./cmake-*.sh --skip-license --prefix=/usr/local/ \
&& rm ./cmake-*.sh
&& rm packages.txt

RUN update-ca-certificates

ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
RUN mkdir -p /py-venv \
&& python3 -m venv /py-venv/ROOT-CI \
&& /py-venv/ROOT-CI/bin/pip install --upgrade pip \
&& /py-venv/ROOT-CI/bin/pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
&& rm -f requirements-root.txt requirements-roottest.txt



#RUN yes | unminimize \
# && apt-get autoremove -y \
# && apt-get clean -y \
# && rm -rf /var/cache/apt/archives/* \
# && rm -rf /var/lib/apt/lists/*

4 changes: 0 additions & 4 deletions ubuntu20/packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ ninja-build
protobuf-compiler
python3
python3-dev
python3-numpy
python3-pip
python3-pytest
python3-setuptools
python3-venv
qtwebengine5-dev
r-base
Expand Down
28 changes: 7 additions & 21 deletions ubuntu22/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@

FROM ubuntu:22.04

# RUN useradd -s /bin/bash sftnight

ENV LANG=C.UTF-8



COPY packages.txt packages.txt
ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN apt-get update -qq \
&& ln -sf /usr/share/zoneinfo/UTC /etc/localtime \
Expand All @@ -18,21 +15,10 @@ RUN apt-get update -qq \
&& rm -rf /var/lib/apt/lists/* \
&& rm packages.txt



ADD https://raw.githubusercontent.com/root-project/root/master/requirements.txt requirements-root.txt
ADD https://raw.githubusercontent.com/root-project/roottest/master/requirements.txt requirements-roottest.txt

RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
&& rm -f requirements-root.txt requirements-roottest.txt


RUN update-ca-certificates

#RUN yes | unminimize \
# && apt-get autoremove -y \
# && apt-get clean -y \
# && rm -rf /var/cache/apt/archives/* \
# && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /py-venv \
&& python3 -m venv /py-venv/ROOT-CI \
&& /py-venv/ROOT-CI/bin/pip install --upgrade pip \
&& /py-venv/ROOT-CI/bin/pip install -r requirements-root.txt -r requirements-roottest.txt openstacksdk \
&& rm -f requirements-root.txt requirements-roottest.txt
4 changes: 0 additions & 4 deletions ubuntu22/packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ ninja-build
nlohmann-json3-dev
python3
python3-dev
python3-numpy
python3-pip
python3-pytest
python3-setuptools
python3-venv
qtwebengine5-dev
r-base
Expand Down
Loading

0 comments on commit 436169b

Please sign in to comment.