Conversation
Docker Compose v2.x changed the release binary naming convention: - v1.x: docker-compose-Linux-x86_64 (OS capitalized, from uname -s) - v2.x: docker-compose-linux-x86_64 (OS lowercase) The old Dockerfile used $(uname -s) which returns "Linux" (capital L). For v2.x releases this produces a 404 URL. curl would silently save the HTTP error page to disk, chmod would succeed, and execution would fail with "exec format error" — the symptom reported in issue GoogleCloudPlatform#616. Fix: pipe uname -s through tr to lowercase the OS name. Also adds --fail to curl so HTTP errors abort the build immediately rather than producing a silently broken binary. Additional: update base image from ubuntu:bionic (EOL Apr 2023) to ubuntu:focal (LTS until Apr 2025), and update default version in cloudbuild.yaml from 1.28.2 to 2.29.7. Fixes GoogleCloudPlatform#616 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes
exec format errorwhen using Docker Compose v2.x with the community builder (issue #616).Root Cause
Docker Compose v2.x changed the release binary naming convention on GitHub:
docker-compose-Linux-x86_64(OS capitalized)docker-compose-linux-x86_64(OS lowercase)The Dockerfile used
$(uname -s)which returnsLinux(capital L). For v2.x releases this produces a 404 URL. Because curl was called without--fail, it silently wrote the HTTP error page to disk. Afterchmod +xsucceeded, trying to execute the HTML file produces:Fix
Dockerfile:
uname -sthroughtr '[:upper:]' '[:lower:]'to produce the lowercase OS name needed by v2.x--failtocurlso HTTP errors (404) abort the build immediately instead of producing a silently broken binaryubuntu:bionic(EOL April 2023) toubuntu:focal(LTS, supported until April 2025)cloudbuild.yaml:
_DOCKER_COMPOSE_VERSIONfrom1.28.2to2.29.7(current stable v2 release)Backward Compatibility
--substitutions _DOCKER_COMPOSE_VERSION=X.Y.Zwill also need to use v2.x format versionsvprefix added to the release tag URL works for all Docker Compose releases (both v1.x and v2.x tags on GitHub include thevprefix)Example
🤖 Generated with Claude Code