Skip to content

Commit

Permalink
Merge pull request #127 from krunalhinguu/add-v25.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
snasovich authored Mar 5, 2024
2 parents 96c9b61 + 7b750ae commit 75e5d20
Show file tree
Hide file tree
Showing 14 changed files with 4,018 additions and 9 deletions.
803 changes: 803 additions & 0 deletions dist/25.0.0.sh

Large diffs are not rendered by default.

803 changes: 803 additions & 0 deletions dist/25.0.1.sh

Large diffs are not rendered by default.

803 changes: 803 additions & 0 deletions dist/25.0.2.sh

Large diffs are not rendered by default.

803 changes: 803 additions & 0 deletions dist/25.0.3.sh

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/25.0.sh
188 changes: 188 additions & 0 deletions pkg/25.0.0/25.0.0.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
--- 25.0.0.orig.sh 2024-02-19 05:43:03.558490687 +0000
+++ 25.0.0.sh 2024-02-19 05:43:03.566490755 +0000
@@ -82,28 +82,34 @@
# the script was uploaded (Should only be modified by upload job):
SCRIPT_COMMIT_SHA="e5543d473431b782227f8908005543bb4389b8de"

-# strip "v" prefix if present
-VERSION="${VERSION#v}"
+CHANNEL="stable"
+DOWNLOAD_URL="https://download.docker.com"
+REPO_FILE="docker-ce.repo"
+VERSION="25.0.0"
+DIND_TEST_WAIT=${DIND_TEST_WAIT:-3s} # Wait time until docker start at dind test env
+
+# Issue https://github.com/rancher/rancher/issues/29246
+adjust_repo_releasever() {
+ DOWNLOAD_URL="https://download.docker.com"
+ case $1 in
+ 7*)
+ releasever=7
+ ;;
+ 8*)
+ releasever=8
+ ;;
+ *)
+ # fedora, or unsupported
+ return
+ ;;
+ esac

-# The channel to install from:
-# * stable
-# * test
-# * edge (deprecated)
-# * nightly (deprecated)
-DEFAULT_CHANNEL_VALUE="stable"
-if [ -z "$CHANNEL" ]; then
- CHANNEL=$DEFAULT_CHANNEL_VALUE
-fi
-
-DEFAULT_DOWNLOAD_URL="https://download.docker.com"
-if [ -z "$DOWNLOAD_URL" ]; then
- DOWNLOAD_URL=$DEFAULT_DOWNLOAD_URL
-fi
-
-DEFAULT_REPO_FILE="docker-ce.repo"
-if [ -z "$REPO_FILE" ]; then
- REPO_FILE="$DEFAULT_REPO_FILE"
-fi
+ for channel in "stable" "test" "nightly"; do
+ $sh_c "$config_manager --setopt=docker-ce-${channel}.baseurl=${DOWNLOAD_URL}/linux/centos/${releasever}/\\\$basearch/${channel} --save";
+ $sh_c "$config_manager --setopt=docker-ce-${channel}-debuginfo.baseurl=${DOWNLOAD_URL}/linux/centos/${releasever}/debug-\\\$basearch/${channel} --save";
+ $sh_c "$config_manager --setopt=docker-ce-${channel}-source.baseurl=${DOWNLOAD_URL}/linux/centos/${releasever}/source/${channel} --save";
+ done
+}

mirror=''
DRY_RUN=${DRY_RUN:-}
@@ -159,6 +165,19 @@
;;
esac

+start_docker() {
+ if [ ! -z $DIND_TEST ]; then
+ # Starting dockerd manually due to dind env is not using systemd
+ dockerd &
+ sleep $DIND_TEST_WAIT
+ elif [ -d '/run/systemd/system' ] ; then
+ $sh_c 'systemctl start docker'
+ else
+ $sh_c 'service docker start'
+ fi
+}
+
+
command_exists() {
command -v "$@" > /dev/null 2>&1
}
@@ -450,10 +469,18 @@
esac
;;

- centos|rhel|sles)
+ centos|rhel|sles|rocky)
if [ -z "$dist_version" ] && [ -r /etc/os-release ]; then
dist_version="$(. /etc/os-release && echo "$VERSION_ID")"
fi
+
+
+ ;;
+
+ oracleserver|ol)
+ lsb_dist="ol"
+ # need to switch lsb_dist to match yum repo URL
+ dist_version="$(rpm -q --whatprovides redhat-release --queryformat "%{VERSION}\n" | sed 's/\/.*//' | sed 's/\..*//' | sed 's/Server*//')"
;;

*)
@@ -553,15 +580,12 @@
set -x
fi
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $pkgs >/dev/null"
+ start_docker
)
echo_docker_as_nonroot
exit 0
;;
- centos|fedora|rhel)
- if [ "$(uname -m)" != "s390x" ] && [ "$lsb_dist" = "rhel" ]; then
- echo "Packages for RHEL are currently only available for s390x."
- exit 1
- fi
+ centos|fedora|rhel|ol|rocky)
if [ "$lsb_dist" = "fedora" ]; then
pkg_manager="dnf"
config_manager="dnf config-manager"
@@ -578,6 +602,9 @@
pkg_suffix="el"
fi
repo_file_url="$DOWNLOAD_URL/linux/$lsb_dist/$REPO_FILE"
+ if [ "$lsb_dist" = "ol" ] || [ "$lsb_dist" = "rocky" ] || [ "$lsb_dist" = "rhel" ]; then
+ repo_file_url="$DOWNLOAD_URL/linux/centos/$REPO_FILE"
+ fi
(
if ! is_dry_run; then
set -x
@@ -589,6 +616,25 @@
$sh_c "$config_manager $disable_channel_flag 'docker-ce-*'"
$sh_c "$config_manager $enable_channel_flag 'docker-ce-$CHANNEL'"
fi
+ if [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "ol" ]; then
+ adjust_repo_releasever "$dist_version"
+ # Add extra repo for version 7.x
+ if [[ "$dist_version" =~ "7." ]] || [ "$dist_version" == "7" ] ; then
+ if [ "$lsb_dist" = "rhel" ]; then
+ $sh_c "$config_manager $enable_channel_flag rhui-REGION-rhel-server-extras"
+ $sh_c "$config_manager $enable_channel_flag rhui-rhel-7-server-rhui-extras-rpms"
+ $sh_c "$config_manager $enable_channel_flag rhui-rhel-7-for-arm-64-extras-rhui-rpms"
+ $sh_c "$config_manager $enable_channel_flag rhel-7-server-rhui-extras-rpms"
+ $sh_c "$config_manager $enable_channel_flag rhel-7-server-extras-rpms"
+ else
+ $sh_c "$config_manager $enable_channel_flag ol7_addons"
+ # Adding OL7 developer repo if doesn't exist
+ if [ "$(yum repolist | grep yum.oracle.com_repo_OracleLinux_OL7_developer > /dev/null || echo add)" == "add" ]; then
+ $sh_c "$config_manager --add-repo https://yum.oracle.com/repo/OracleLinux/OL7/developer/x86_64"
+ fi
+ fi
+ fi
+ fi
$sh_c "$pkg_manager makecache"
)
pkg_version=""
@@ -648,8 +694,7 @@
if [ "$dist_version" = "15.3" ]; then
sles_version="SLE_15_SP3"
else
- sles_minor_version="${dist_version##*.}"
- sles_version="15.$sles_minor_version"
+ sles_version="SLE_15_SP2"
fi
repo_file_url="$DOWNLOAD_URL/linux/$lsb_dist/$REPO_FILE"
pre_reqs="ca-certificates curl libseccomp2 awk"
@@ -715,10 +760,25 @@
set -x
fi
$sh_c "zypper -q install -y $pkgs"
+ if ! command_exists iptables; then
+ $sh_c "$pkg_manager install -y -q iptables"
+ fi
+ start_docker
)
echo_docker_as_nonroot
exit 0
;;
+ rancheros)
+ (
+ set -x
+ $sh_c "sleep 3;ros engine list --update"
+ engine_version="$(sudo ros engine list | awk '{print $2}' | grep ${docker_version} | tail -n 1)"
+ if [ "$engine_version" != "" ]; then
+ $sh_c "ros engine switch -f $engine_version"
+ fi
+ )
+ exit 0
+ ;;
*)
if [ -z "$lsb_dist" ]; then
if is_darwin; then
11 changes: 11 additions & 0 deletions pkg/25.0.0/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

DOCKER_GIT_COMMIT="e5543d473431b782227f8908005543bb4389b8de"

TEST_OS_IMAGE_NAME=(redhat/ubi9 oraclelinux centos ubuntu rockylinux quay.io/centos/centos)
TEST_OS_IMAGE_TAG[0]="9.2"
TEST_OS_IMAGE_TAG[1]="8 9"
TEST_OS_IMAGE_TAG[2]="centos7"
TEST_OS_IMAGE_TAG[3]="20.04 22.04"
TEST_OS_IMAGE_TAG[4]="8 9"
TEST_OS_IMAGE_TAG[5]="stream8"
188 changes: 188 additions & 0 deletions pkg/25.0.1/25.0.1.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
--- 25.0.1.orig.sh 2024-02-19 05:43:35.974503244 +0000
+++ 25.0.1.sh 2024-02-19 05:43:35.978503069 +0000
@@ -82,28 +82,34 @@
# the script was uploaded (Should only be modified by upload job):
SCRIPT_COMMIT_SHA="e5543d473431b782227f8908005543bb4389b8de"

-# strip "v" prefix if present
-VERSION="${VERSION#v}"
+CHANNEL="stable"
+DOWNLOAD_URL="https://download.docker.com"
+REPO_FILE="docker-ce.repo"
+VERSION="25.0.1"
+DIND_TEST_WAIT=${DIND_TEST_WAIT:-3s} # Wait time until docker start at dind test env
+
+# Issue https://github.com/rancher/rancher/issues/29246
+adjust_repo_releasever() {
+ DOWNLOAD_URL="https://download.docker.com"
+ case $1 in
+ 7*)
+ releasever=7
+ ;;
+ 8*)
+ releasever=8
+ ;;
+ *)
+ # fedora, or unsupported
+ return
+ ;;
+ esac

-# The channel to install from:
-# * stable
-# * test
-# * edge (deprecated)
-# * nightly (deprecated)
-DEFAULT_CHANNEL_VALUE="stable"
-if [ -z "$CHANNEL" ]; then
- CHANNEL=$DEFAULT_CHANNEL_VALUE
-fi
-
-DEFAULT_DOWNLOAD_URL="https://download.docker.com"
-if [ -z "$DOWNLOAD_URL" ]; then
- DOWNLOAD_URL=$DEFAULT_DOWNLOAD_URL
-fi
-
-DEFAULT_REPO_FILE="docker-ce.repo"
-if [ -z "$REPO_FILE" ]; then
- REPO_FILE="$DEFAULT_REPO_FILE"
-fi
+ for channel in "stable" "test" "nightly"; do
+ $sh_c "$config_manager --setopt=docker-ce-${channel}.baseurl=${DOWNLOAD_URL}/linux/centos/${releasever}/\\\$basearch/${channel} --save";
+ $sh_c "$config_manager --setopt=docker-ce-${channel}-debuginfo.baseurl=${DOWNLOAD_URL}/linux/centos/${releasever}/debug-\\\$basearch/${channel} --save";
+ $sh_c "$config_manager --setopt=docker-ce-${channel}-source.baseurl=${DOWNLOAD_URL}/linux/centos/${releasever}/source/${channel} --save";
+ done
+}

mirror=''
DRY_RUN=${DRY_RUN:-}
@@ -159,6 +165,19 @@
;;
esac

+start_docker() {
+ if [ ! -z $DIND_TEST ]; then
+ # Starting dockerd manually due to dind env is not using systemd
+ dockerd &
+ sleep $DIND_TEST_WAIT
+ elif [ -d '/run/systemd/system' ] ; then
+ $sh_c 'systemctl start docker'
+ else
+ $sh_c 'service docker start'
+ fi
+}
+
+
command_exists() {
command -v "$@" > /dev/null 2>&1
}
@@ -450,10 +469,18 @@
esac
;;

- centos|rhel|sles)
+ centos|rhel|sles|rocky)
if [ -z "$dist_version" ] && [ -r /etc/os-release ]; then
dist_version="$(. /etc/os-release && echo "$VERSION_ID")"
fi
+
+
+ ;;
+
+ oracleserver|ol)
+ lsb_dist="ol"
+ # need to switch lsb_dist to match yum repo URL
+ dist_version="$(rpm -q --whatprovides redhat-release --queryformat "%{VERSION}\n" | sed 's/\/.*//' | sed 's/\..*//' | sed 's/Server*//')"
;;

*)
@@ -553,15 +580,12 @@
set -x
fi
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $pkgs >/dev/null"
+ start_docker
)
echo_docker_as_nonroot
exit 0
;;
- centos|fedora|rhel)
- if [ "$(uname -m)" != "s390x" ] && [ "$lsb_dist" = "rhel" ]; then
- echo "Packages for RHEL are currently only available for s390x."
- exit 1
- fi
+ centos|fedora|rhel|ol|rocky)
if [ "$lsb_dist" = "fedora" ]; then
pkg_manager="dnf"
config_manager="dnf config-manager"
@@ -578,6 +602,9 @@
pkg_suffix="el"
fi
repo_file_url="$DOWNLOAD_URL/linux/$lsb_dist/$REPO_FILE"
+ if [ "$lsb_dist" = "ol" ] || [ "$lsb_dist" = "rocky" ] || [ "$lsb_dist" = "rhel" ]; then
+ repo_file_url="$DOWNLOAD_URL/linux/centos/$REPO_FILE"
+ fi
(
if ! is_dry_run; then
set -x
@@ -589,6 +616,25 @@
$sh_c "$config_manager $disable_channel_flag 'docker-ce-*'"
$sh_c "$config_manager $enable_channel_flag 'docker-ce-$CHANNEL'"
fi
+ if [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "ol" ]; then
+ adjust_repo_releasever "$dist_version"
+ # Add extra repo for version 7.x
+ if [[ "$dist_version" =~ "7." ]] || [ "$dist_version" == "7" ] ; then
+ if [ "$lsb_dist" = "rhel" ]; then
+ $sh_c "$config_manager $enable_channel_flag rhui-REGION-rhel-server-extras"
+ $sh_c "$config_manager $enable_channel_flag rhui-rhel-7-server-rhui-extras-rpms"
+ $sh_c "$config_manager $enable_channel_flag rhui-rhel-7-for-arm-64-extras-rhui-rpms"
+ $sh_c "$config_manager $enable_channel_flag rhel-7-server-rhui-extras-rpms"
+ $sh_c "$config_manager $enable_channel_flag rhel-7-server-extras-rpms"
+ else
+ $sh_c "$config_manager $enable_channel_flag ol7_addons"
+ # Adding OL7 developer repo if doesn't exist
+ if [ "$(yum repolist | grep yum.oracle.com_repo_OracleLinux_OL7_developer > /dev/null || echo add)" == "add" ]; then
+ $sh_c "$config_manager --add-repo https://yum.oracle.com/repo/OracleLinux/OL7/developer/x86_64"
+ fi
+ fi
+ fi
+ fi
$sh_c "$pkg_manager makecache"
)
pkg_version=""
@@ -648,8 +694,7 @@
if [ "$dist_version" = "15.3" ]; then
sles_version="SLE_15_SP3"
else
- sles_minor_version="${dist_version##*.}"
- sles_version="15.$sles_minor_version"
+ sles_version="SLE_15_SP2"
fi
repo_file_url="$DOWNLOAD_URL/linux/$lsb_dist/$REPO_FILE"
pre_reqs="ca-certificates curl libseccomp2 awk"
@@ -715,10 +760,25 @@
set -x
fi
$sh_c "zypper -q install -y $pkgs"
+ if ! command_exists iptables; then
+ $sh_c "$pkg_manager install -y -q iptables"
+ fi
+ start_docker
)
echo_docker_as_nonroot
exit 0
;;
+ rancheros)
+ (
+ set -x
+ $sh_c "sleep 3;ros engine list --update"
+ engine_version="$(sudo ros engine list | awk '{print $2}' | grep ${docker_version} | tail -n 1)"
+ if [ "$engine_version" != "" ]; then
+ $sh_c "ros engine switch -f $engine_version"
+ fi
+ )
+ exit 0
+ ;;
*)
if [ -z "$lsb_dist" ]; then
if is_darwin; then
Loading

0 comments on commit 75e5d20

Please sign in to comment.