Skip to content

Commit

Permalink
Merge package installation into a single layer
Browse files Browse the repository at this point in the history
Currently, CI is failing weirdly because of ubuntu repos returning 404.
I suspect that is because the package index layer, `apt-get update`, is
a cache-hit but the next layer that installs packages are not. This
causes `apt` to work with outdated indices.

Further, it's just good container hygiene to keep those in a single
layer to make sure package index doesn't end up in a layer of the image.
  • Loading branch information
lunacd committed Jul 10, 2024
1 parent beb05a8 commit 8595c08
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
15 changes: 7 additions & 8 deletions tests/docker/rockylinux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FROM rockylinux:9

# Enable EPEL
RUN dnf update -y
RUN dnf install -y 'dnf-command(config-manager)'
RUN dnf config-manager --set-enabled crb -y
RUN dnf install epel-release -y

# Install dependencies
RUN dnf install -y \
RUN dnf update -y \
dnf install -y 'dnf-command(config-manager)' \
dnf config-manager --set-enabled crb -y \
dnf install epel-release -y \
dnf install -y \
python3.11 \
python3-pip \
pkgconf-pkg-config \
Expand All @@ -20,8 +19,8 @@ RUN dnf install -y \
expected-devel \
gtest-devel \
fmt-devel \
cli11-devel
RUN dnf clean all
cli11-devel \
dnf clean all
RUN update-alternatives --install /usr/local/bin/python python /usr/bin/python3.11 10
# Install meson from pip
RUN python3 -m pip install -U meson==0.64.1
8 changes: 4 additions & 4 deletions tests/docker/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:22.04

# Install dependencies
RUN apt-get update
RUN apt-get install -y \
RUN apt-get update && \
apt-get install -y \
python3.11 \
python3-pip \
pkg-config \
Expand All @@ -15,8 +15,8 @@ RUN apt-get install -y \
libexpected-dev \
libgtest-dev \
libfmt-dev \
libcli11-dev
RUN apt-get clean
libcli11-dev && \
apt-get clean
RUN update-alternatives --install /usr/local/bin/python python /usr/bin/python3.11 10
# Install meson from pip
RUN python3 -m pip install -U meson==0.64.1

0 comments on commit 8595c08

Please sign in to comment.