-
Notifications
You must be signed in to change notification settings - Fork 41
Fix Docker 29.x compatibility issues with Traefik - v1.5 #818
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
Open
rquidute
wants to merge
3
commits into
v2.14+fall2025
Choose a base branch
from
workaround_docker_traefik_issue_v_1_5
base: v2.14+fall2025
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+245
−2
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| #! /usr/bin/env bash | ||
|
|
||
| # | ||
| # Copyright (c) 2025 Project CHIP Authors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # This script fixes Docker 29.x compatibility issues with Traefik | ||
| # by downgrading to the latest compatible Docker 28.x version. | ||
|
|
||
| set -e | ||
|
|
||
| ROOT_DIR=$(realpath $(dirname "$0")/..) | ||
| SCRIPT_DIR="$ROOT_DIR/scripts" | ||
|
|
||
| source "$SCRIPT_DIR/utils.sh" | ||
|
|
||
| print_start_of_script | ||
|
|
||
| # Function to get Docker version | ||
| get_docker_version() { | ||
| if command -v docker >/dev/null 2>&1; then | ||
| docker --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 | ||
| else | ||
| echo "not_installed" | ||
| fi | ||
| } | ||
|
|
||
| # Function to compare version numbers | ||
| version_greater_than() { | ||
| # Returns 0 (true) if $1 > $2 | ||
| [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" != "$1" ] | ||
| } | ||
|
|
||
| print_script_step "Checking current Docker version" | ||
| CURRENT_VERSION=$(get_docker_version) | ||
|
|
||
| if [ "$CURRENT_VERSION" = "not_installed" ]; then | ||
| echo "Docker is not installed. Please install Docker first using the installation scripts." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Current Docker version: $CURRENT_VERSION" | ||
|
|
||
| # Check if Docker version is 29.x or higher | ||
| if version_greater_than "$CURRENT_VERSION" "28.9.9"; then | ||
| print_script_step "Docker version $CURRENT_VERSION is >= 29.x, which has compatibility issues with Traefik" | ||
| print_script_step "Downgrading Docker to a compatible version (latest 28.x)" | ||
|
|
||
| # Remove current Docker installation | ||
| print_script_step "Removing current Docker installation" | ||
| sudo apt-get remove -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin || true | ||
|
|
||
| # Ensure Docker repository is available | ||
| if [ ! -f /etc/apt/sources.list.d/docker.list ]; then | ||
| echo "Docker repository not found. Setting up Docker repository..." | ||
| $SCRIPT_DIR/ubuntu/1.1-install-docker-repository.sh | ||
| fi | ||
|
|
||
| # Update package cache | ||
| sudo apt-get update -y | ||
|
|
||
| # Install Docker version using the same logic as the working fix | ||
| print_script_step "Installing Docker (excluding version 29.x)" | ||
|
|
||
| # Get the latest version that is not 29.x (same logic as working fix) | ||
| DOCKER_VERSION=$(apt-cache madison docker-ce | awk '$3 !~ /^5:29\./ {print $3; exit}') | ||
|
|
||
| if [ -n "$DOCKER_VERSION" ]; then | ||
| print_script_step "Installing docker-ce version $DOCKER_VERSION (excluding 29.x)" | ||
| sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-downgrades docker-ce=$DOCKER_VERSION docker-ce-cli=$DOCKER_VERSION containerd.io docker-buildx-plugin docker-compose-plugin | ||
| else | ||
| echo "ERROR: No suitable docker-ce version found (excluding 29.x)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Hold Docker packages to prevent automatic upgrades | ||
| print_script_step "Holding Docker packages to prevent automatic upgrades to 29.x" | ||
| sudo apt-mark hold docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | ||
|
|
||
| # Verify installation | ||
| NEW_VERSION=$(get_docker_version) | ||
| echo "New Docker version: $NEW_VERSION" | ||
|
|
||
| if version_greater_than "$NEW_VERSION" "28.9.9"; then | ||
| echo "WARNING: Docker version is still >= 29.x. You may need to manually downgrade." | ||
| echo "Current version: $NEW_VERSION" | ||
| exit 1 | ||
| fi | ||
|
|
||
| print_script_step "Docker successfully downgraded to version $NEW_VERSION" | ||
|
|
||
| # Restart Docker service | ||
| print_script_step "Restarting Docker service" | ||
| sudo systemctl restart docker | ||
|
|
||
| # Add current user to docker group if not already added | ||
| if ! groups $USER | grep &>/dev/null '\bdocker\b'; then | ||
| print_script_step "Adding user $USER to docker group" | ||
| sudo usermod -aG docker $USER | ||
| echo "NOTE: You may need to log out and back in for docker group changes to take effect" | ||
| fi | ||
|
|
||
| print_script_step "Docker compatibility fix completed successfully" | ||
|
|
||
| else | ||
| echo "Docker version $CURRENT_VERSION is compatible (< 29.x). No action needed." | ||
| fi | ||
|
|
||
| print_end_of_script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| #! /usr/bin/env bash | ||
|
|
||
| # | ||
| # Copyright (c) 2025 Project CHIP Authors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # This is a standalone workaround script to fix Docker 29.x compatibility issues | ||
| # It stops the services, fixes Docker, and restarts the services. | ||
|
|
||
| set -e | ||
|
|
||
| ROOT_DIR=$(realpath $(dirname "$0")/..) | ||
| SCRIPT_DIR="$ROOT_DIR/scripts" | ||
|
|
||
| echo "===================================" | ||
| echo "Docker 29.x Compatibility Fix" | ||
| echo "===================================" | ||
| echo "" | ||
| echo "This script will:" | ||
| echo "1. Stop certification tool services" | ||
| echo "2. Fix Docker compatibility by downgrading from 29.x to 28.x" | ||
| echo "3. Build backend and frontend Docker images" | ||
| echo "4. Restart certification tool services" | ||
| echo "" | ||
| echo "WARNING: This will temporarily stop all running services." | ||
| echo "" | ||
|
|
||
| # Ask for confirmation | ||
| read -p "Do you want to continue? (y/N): " -n 1 -r | ||
| echo "" | ||
| if [[ ! $REPLY =~ ^[Yy]$ ]]; then | ||
| echo "Operation cancelled." | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "Step 1/4: Stopping certification tool services..." | ||
| echo "==============================================" | ||
| if [ -f "$SCRIPT_DIR/stop.sh" ]; then | ||
| $SCRIPT_DIR/stop.sh | ||
| echo "Services stopped successfully." | ||
| else | ||
| echo "Warning: $SCRIPT_DIR/stop.sh not found, continuing with Docker fix..." | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "Step 2/4: Fixing Docker compatibility..." | ||
| echo "=======================================" | ||
| if [ -f "$SCRIPT_DIR/fix-docker-compatibility.sh" ]; then | ||
| $SCRIPT_DIR/fix-docker-compatibility.sh | ||
| echo "Docker compatibility fix completed." | ||
| else | ||
| echo "Error: $SCRIPT_DIR/fix-docker-compatibility.sh not found!" | ||
| echo "Please ensure the script exists and try again." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "Step 3/4: Building backend and frontend Docker images..." | ||
| echo "==================================================" | ||
|
|
||
| echo "Building backend image..." | ||
| if [ -f "$ROOT_DIR/backend/scripts/build-docker-image.sh" ]; then | ||
| cd "$ROOT_DIR" | ||
| ./backend/scripts/build-docker-image.sh | ||
| echo "Backend image built successfully." | ||
| else | ||
| echo "Warning: $ROOT_DIR/backend/scripts/build-docker-image.sh not found." | ||
| fi | ||
|
|
||
| echo "Building frontend image..." | ||
| if [ -f "$ROOT_DIR/frontend/scripts/build-docker-image.sh" ]; then | ||
| cd "$ROOT_DIR" | ||
| ./frontend/scripts/build-docker-image.sh | ||
| echo "Frontend image built successfully." | ||
| else | ||
| echo "Warning: $ROOT_DIR/frontend/scripts/build-docker-image.sh not found." | ||
| fi | ||
|
|
||
| echo "Pulling chip-cert-bins Docker image..." | ||
| if [ -f "$ROOT_DIR/backend/test_collections/matter/scripts/update-sample-apps.sh" ]; then | ||
| cd "$ROOT_DIR" | ||
| ./backend/test_collections/matter/scripts/update-sample-apps.sh | ||
|
rquidute marked this conversation as resolved.
|
||
| echo "Chip-cert-bins image updated successfully." | ||
| else | ||
| echo "Warning: $ROOT_DIR/backend/test_collections/matter/scripts/update-sample-apps.sh not found." | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "Step 4/4: Starting certification tool services..." | ||
| echo "==============================================" | ||
| if [ -f "$SCRIPT_DIR/start.sh" ]; then | ||
| $SCRIPT_DIR/start.sh | ||
| echo "Services started successfully." | ||
| else | ||
| echo "Warning: $SCRIPT_DIR/start.sh not found. Please start services manually." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "===================================" | ||
| echo "Docker compatibility fix completed!" | ||
| echo "===================================" | ||
| echo "" | ||
| echo "Your certification tool should now be running with a compatible Docker version." | ||
| echo "You can verify the fix by checking that there are no more API version errors in:" | ||
| echo " docker logs certification-tool-proxy-1" | ||
| echo "" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.