From f2d97016ef734f7d348ae485bb9d2a2bc33a959b Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 17 Feb 2026 10:25:45 -0800 Subject: [PATCH] Deal with Docker's minimum API version nonsense MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.docker.com/blog/docker-engine-version-29/ 🙃 --- .github/workflows/ci.yml | 19 +++++++++++++++++++ .test/test.sh | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca220ae..8e32b24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Install Bashbrew run: | # not doing "uses: docker-library/bashbrew@xxx" because it'll build which is slow and we don't need more than just bashbrew here @@ -29,7 +30,22 @@ jobs: chmod +x .bin/bashbrew .bin/bashbrew --version echo "$PWD/.bin" >> "$GITHUB_PATH" + + # deal with Docker's API version nonsense (the whole entire point of API versioning is avoiding breaking changes, so it's rich and ironic for the prior "LTS" version to have breaking changes from this change) + # https://www.docker.com/blog/docker-engine-version-29/ + - run: | + sudo mkdir -p /etc/systemd/system/docker.service.d + sudo tee /etc/systemd/system/docker.service.d/minimum-api-version.conf <<-'EOF' + [Service] + Environment=DOCKER_MIN_API_VERSION=1.42 + # API version 1.42 is Docker 23.x + EOF + sudo systemctl daemon-reload + sudo systemctl restart docker.service + docker version + - run: .test/test.sh --deploy + - uses: actions/upload-artifact@v4 with: name: coverage @@ -38,7 +54,10 @@ jobs: .test/.coverage/GOCOVERDIR/ include-hidden-files: true if-no-files-found: error + - name: gofmt run: find -name '*.go' -type f -exec ./.go-env.sh gofmt -l -s -w '{}' + + - run: git diff --exit-code + # TODO download latest coverage artifacts from HEAD / PR target to emulate Codecov but without another flaky third-party service that's begging for write-access to all our repositories via a GitHub App? 👀 diff --git a/.test/test.sh b/.test/test.sh index 5358849..16f1e8f 100755 --- a/.test/test.sh +++ b/.test/test.sh @@ -140,7 +140,7 @@ if [ -n "$doDeploy" ]; then docker rm -vf meta-scripts-test-registry &> /dev/null || : trap 'docker rm -vf meta-scripts-test-registry &> /dev/null || :' EXIT docker run --detach --name meta-scripts-test-registry --publish 5000 registry:2 - registryPort="$(DOCKER_API_VERSION=1.41 docker container inspect --format '{{ index .NetworkSettings.Ports "5000/tcp" 0 "HostPort" }}' meta-scripts-test-registry)" + registryPort="$(DOCKER_API_VERSION=1.42 docker container inspect --format '{{ index .NetworkSettings.Ports "5000/tcp" 0 "HostPort" }}' meta-scripts-test-registry)" # apparently Tianon's local system is too good and the registry spins up fast enough, but this needs a small "wait for the registry to be ready" loop for systems like GHA (adding "--cpus 0.01" to the above "docker run" seems to replicate the race reasonably well) tries=10