Skip to content

Commit

Permalink
Merge pull request #158 from crazy-max/fix-rocky
Browse files Browse the repository at this point in the history
dockerfile: fix test-base-rhel
  • Loading branch information
tonistiigi authored Jun 13, 2024
2 parents 81db39e + 6b6583d commit 769f2b0
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,26 @@ RUN <<EOT
set -ex
if ! yum install -y epel-release; then
if . /etc/os-release 2>/dev/null; then
if [ "$ID" != "fedora" ]; then
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${VERSION:0:1}.noarch.rpm
fi
case "$ID" in
fedora) ;;
rocky)
dnf install -y epel-release
;;
*)
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${VERSION:0:1}.noarch.rpm
yum update -y
;;
esac
fi
fi
if command -v dnf >/dev/null 2>/dev/null; then
dnf install -y bats vim
else
yum install -y bats vim
fi
EOT
RUN --mount=type=cache,target=/pkg-cache \
rm -rf /var/cache/yum && \
ln -s /pkg-cache /var/cache/yum && \
yum update -y && yum -y install bats vim
WORKDIR /work


FROM test-base-${TEST_BASE_TYPE} AS test-base
ADD --chmod=755 https://raw.githubusercontent.com/fsaintjacques/semver-tool/3.4.0/src/semver /usr/bin/semver
COPY --from=bats-assert . .
Expand Down

0 comments on commit 769f2b0

Please sign in to comment.