Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to CentOS Stream 10 #245

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions build-containerd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,23 @@ buildContainerd() {
mkdir /workspace/containerd-packaging-${DISTRO}
cp -r /workspace/containerd-packaging-ref/* /workspace/containerd-packaging-${DISTRO}

if [[ "${DISTRO_NAME}:${DISTRO_VERS}" == centos:8 ]]
then
if [[ "${DISTRO_NAME}:${DISTRO_VERS}" == centos:8 ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may be able to skip these checks now. iirc the old builds were using the now-deprecated dockerhub images, but it looks like the official build repo has moved to the quay repos. https://github.com/docker/docker-ce-packaging/blob/master/rpm/centos-10/Dockerfile#L6
looking at the script though, maybe this part has to stay as-is. i don't see where that TARGET gets used from a quick look

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I know why we still need it. It's best I order it so that we're on the same page :) The most important step would be step 5.

  1. We get the list of distributions to be built: https://github.com/ppc64le-cloud/docker-ce-build/blob/main/get-env.sh#L69
  2. We split and take the first part, here, CentOS and store it in DISTRO_NAME https://github.com/ppc64le-cloud/docker-ce-build/blob/main/build-containerd.sh#L48
  3. We take the second part, here, 10 and store it in DISTRO_VERS https://github.com/ppc64le-cloud/docker-ce-build/blob/main/build-containerd.sh#L49
  4. Now build containerd: https://github.com/ppc64le-cloud/docker-ce-build/blob/main/build-containerd.sh#L86
  5. The target will be used here https://github.com/docker/containerd-packaging/blob/main/Makefile#L111

##
# Switch to quay.io for CentOS 8 stream
# See https://github.com/docker/containerd-packaging/pull/263
##
echo "Switching to CentOS 8 stream and using quay.io"

TARGET="quay.io/centos/centos:stream8"

elif [[ "${DISTRO_NAME}:${DISTRO_VERS}" == centos:9 ]]
then
elif [[ "${DISTRO_NAME}:${DISTRO_VERS}" == centos:9 ]]; then
##
# Switch to quay.io for CentOS 9 stream
# See https://github.com/docker/containerd-packaging/pull/283
##
echo "Switching to CentOS 9 stream and using quay.io"

TARGET="quay.io/centos/centos:stream9"
elif [[ "${DISTRO_NAME}:${DISTRO_VERS}" == centos:10 ]]; then
echo "Switching to CentOS 10 stream and using quay.io"
TARGET="quay.io/centos/centos:stream10"
fi

local MAKE_OPTS="REF=${CONTAINERD_TAG}"
Expand Down
15 changes: 9 additions & 6 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,26 +125,29 @@ BUILD_ARGS+=" --build-arg GO_VERSION=${GO_VERSION}"

echo "### # Building the test image: ${IMAGE_NAME} # ###"
# Building the test image
if [[ "${DISTRO_NAME}:${DISTRO_VERS}" == centos:8 ]]
then
if [[ "${DISTRO_NAME}:${DISTRO_VERS}" == centos:8 ]]; then
##
# Switch to quay.io for CentOS 8 stream
# See https://github.com/docker/containerd-packaging/pull/263
# See https://github.com/docker-library/official-images/pull/11831
##
echo "Temporary fix: patching Dockerfile for using CentOS 8 stream and quay.io "
sed -i 's/FROM ppc64le.*/FROM quay.io\/centos\/centos\:stream8/g' Dockerfile

elif [[ "${DISTRO_NAME}:${DISTRO_VERS}" == centos:9 ]]
then
elif [[ "${DISTRO_NAME}:${DISTRO_VERS}" == centos:9 ]]; then
##
# Switch to quay.io for CentOS 8 stream
# See https://github.com/docker/containerd-packaging/pull/283
##
echo "Temporary fix: patching Dockerfile for using CentOS 9 stream and quay.io "
sed -i 's/FROM ppc64le.*/FROM quay.io\/centos\/centos\:stream9/g' Dockerfile
elif [[ "${DISTRO_NAME}:${DISTRO_VERS}" == centos:10 ]]; then
##
# Switch to quay.io for CentOS 10 stream
##
echo "Temporary fix: patching Dockerfile for using CentOS 10 stream and quay.io "
sed -i 's/FROM ppc64le.*/FROM quay.io\/centos\/centos\:stream10/g' Dockerfile
fi

BUILD_ARGS+=" --build-arg DISTRO_NAME=${DISTRO_NAME} --build-arg DISTRO_VERS=${DISTRO_VERS}"

if [[ "$TEST_MODE" = "staging" || "$TEST_MODE" = "release" ]]; then
Expand Down