Compare commits

...

21 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
4c9b3b011a Merge pull request #49317 from thaJeztah/27.x_backport_bump_dev_tools
[27.x backport] Dockerfile: dev-container: update CLI v27.5.0, buildx v0.20.0, compose v2.32.4
2025-01-22 00:46:50 +01:00
Sebastiaan van Stijn
0da7a2656e Dockerfile: update compose to v2.32.4
Update the compose cli plugin used in the dev-container

full diff: https://github.com/docker/compose/compare/v2.30.3...v2.32.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 836a5fac10)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-21 17:42:37 +01:00
Sebastiaan van Stijn
4c8ec29141 Dockerfile: update buildx to v0.20.0
Update the buildx cli plugin used in the dev-container

full diff: https://github.com/docker/buildx/compare/v0.18.0..v0.20.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b75a75017d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-21 17:42:36 +01:00
Sebastiaan van Stijn
fbc854d9d3 Dockerfile: update docker CLI to v27.5.0
Update the Docker CLI used in the dev-container
full diff: https://github.com/docker/cli/compare/v27.3.1...v27.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1e2a828ed5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-21 17:42:34 +01:00
Sebastiaan van Stijn
36c72d4c3d Merge pull request #49322 from thaJeztah/27.x_backport_bake-v6
[27.x backport] ci: update bake-action to v6, ci(bin-image): fix bake build
2025-01-21 17:42:00 +01:00
CrazyMax
e85906c6a8 ci(bin-image): fix bake build
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit d86920b9b3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-21 16:43:21 +01:00
CrazyMax
542e33c421 ci: update bake-action to v6
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit f8a973ba4e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-21 16:42:59 +01:00
Paweł Gronowski
c0df67813a Merge pull request #49314 from vvoland/49313-27.x
[27.x backport] gha: Adjust release branches
2025-01-21 10:54:03 +01:00
Paweł Gronowski
95d18194a4 gha: Adjust release branches
Adjust all workflows to also run on branches like `27.x`

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 5e9ee1a849)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-01-20 18:22:23 +01:00
Sebastiaan van Stijn
13eca88597 Merge pull request #49312 from thaJeztah/27.x_bump_golang_1.22.11
[27.x] update to go1.22.11 (fix CVE-2024-45341, CVE-2024-45336)
2025-01-20 17:34:41 +01:00
Sebastiaan van Stijn
c83862c541 update to go1.22.11 (fix CVE-2024-45341, CVE-2024-45336)
go1.22.11 (released 2025-01-16) includes security fixes to the crypto/x509 and
net/http packages, as well as bug fixes to the runtime. See the Go 1.22.11
milestone on our issue tracker for details.

- https://github.com/golang/go/issues?q=milestone%3AGo1.22.11+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.22.10...go1.22.11

Hello gophers,

We have just released Go versions 1.23.5 and 1.22.11, minor point releases.

These minor releases include 2 security fixes following the security policy:

- crypto/x509: usage of IPv6 zone IDs can bypass URI name constraints

  A certificate with a URI which has a IPv6 address with a zone ID may
  incorrectly satisfy a URI name constraint that applies to the certificate
  chain.

  Certificates containing URIs are not permitted in the web PKI, so this
  only affects users of private PKIs which make use of URIs.

  Thanks to Juho Forsén of Mattermost for reporting this issue.

  This is CVE-2024-45341 and Go issue https://go.dev/issue/71156.

- net/http: sensitive headers incorrectly sent after cross-domain redirect

  The HTTP client drops sensitive headers after following a cross-domain redirect.
  For example, a request to a.com/ containing an Authorization header which is
  redirected to b.com/ will not send that header to b.com.

  In the event that the client received a subsequent same-domain redirect, however,
  the sensitive headers would be restored. For example, a chain of redirects from
  a.com/, to b.com/1, and finally to b.com/2 would incorrectly send the Authorization
  header to b.com/2.

  Thanks to Kyle Seely for reporting this issue.

  This is CVE-2024-45336 and Go issue https://go.dev/issue/70530.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-20 15:59:42 +01:00
Sebastiaan van Stijn
78bccb9709 Merge pull request #49308 from thaJeztah/27.x_backport_gha-arm64
[27.x backport] ci: switch from jenkins to gha for arm64 build and tests (and set correct go version for branch)
2025-01-20 15:59:00 +01:00
Sebastiaan van Stijn
0d4f27db11 Merge pull request #49306 from thaJeztah/27.x_backport_49240_ignore_br_netfilter_error
[27.x backport] Allow users to ignore missing br_netfilter
2025-01-20 12:37:13 +01:00
Sebastiaan van Stijn
e0b88bc9a8 Merge pull request #49307 from thaJeztah/27.x_backport_bridge_startup_error
[27.x backport] Recover from default bridge init failure
2025-01-20 11:53:13 +01:00
Sebastiaan van Stijn
174ce6b376 Merge pull request #49304 from AkihiroSuda/cherrypick-49303-27
[27.x] Dockerfile: update RootlessKit to v2.3.2
2025-01-20 11:46:11 +01:00
Sebastiaan van Stijn
6c832d05c4 gha: set arm64 GO_VERSION to 1.22.10
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-20 10:48:57 +01:00
CrazyMax
36706f0e5f ci: switch from jenkins to gha for arm64 build and tests
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit 8c236de735)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-20 10:45:24 +01:00
Rob Murray
b33299da85 Bridge: on network delete, make sure it's deleted from store
Signed-off-by: Rob Murray <rob.murray@docker.com>
(cherry picked from commit 22c02219de)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-20 10:35:36 +01:00
Rob Murray
d57309014d Move integration/network/bridge_test.go to bridge subdir
Also make it Linux-only, as the bridge driver is Linux only and
all of the tests had skips for Windows.

Signed-off-by: Rob Murray <rob.murray@docker.com>
(cherry picked from commit 24f53eba7f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-20 10:35:26 +01:00
Rob Murray
ad04c7b55a Allow users to ignore missing br_netfilter
Since commit 0f8fc31, the bridge driver will try to load kernel
module br_netfilter if the userland proxy is disabled. If it fails,
we're in unknown territory, so it's treated as an error. At the
very least, containers will not be able to access host ports
mapped to other containers in the same network.

Before that, and before commit 5c499fc delayed the module load
until it was needed - it was loaded unconditionally, but errors
were only logged.

So, on systems where the module is not available, or could not be
loaded/configured, no error was reported and things "worked" (as
long as you didn't try to use something that didn't work).

That behaviour has been useful to some. So, make it possible to
ignore the problem by setting env var:
  DOCKER_IGNORE_BR_NETFILTER_ERROR=1

Signed-off-by: Rob Murray <rob.murray@docker.com>
(cherry picked from commit e7bd60ee2d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-20 10:21:34 +01:00
Akihiro Suda
70a866e37e Dockerfile: update RootlessKit to v2.3.2
https://github.com/rootless-containers/rootlesskit/releases/tag/v2.3.2

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit aa565ec1ef)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-01-20 17:41:26 +09:00
22 changed files with 485 additions and 230 deletions

View File

@@ -21,7 +21,7 @@ on:
default: "graphdriver"
env:
GO_VERSION: "1.22.10"
GO_VERSION: "1.22.11"
GOTESTLIST_VERSION: v0.3.1
TESTSTAT_VERSION: v0.1.25
ITG_CLI_MATRIX_SIZE: 6
@@ -52,7 +52,7 @@ jobs:
buildkitd-flags: --debug
-
name: Build dev image
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: dev
set: |
@@ -138,7 +138,7 @@ jobs:
buildkitd-flags: --debug
-
name: Build dev image
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: dev
set: |
@@ -192,7 +192,7 @@ jobs:
buildkitd-flags: --debug
-
name: Build dev image
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: dev
set: |
@@ -250,7 +250,7 @@ jobs:
buildkitd-flags: --debug
-
name: Build dev image
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: dev
set: |
@@ -396,7 +396,7 @@ jobs:
buildkitd-flags: --debug
-
name: Build dev image
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: dev
set: |

View File

@@ -29,7 +29,7 @@ on:
default: false
env:
GO_VERSION: "1.22.10"
GO_VERSION: "1.22.11"
GOTESTLIST_VERSION: v0.3.1
TESTSTAT_VERSION: v0.1.25
WINDOWS_BASE_IMAGE: mcr.microsoft.com/windows/servercore

276
.github/workflows/arm64.yml vendored Normal file
View File

@@ -0,0 +1,276 @@
name: arm64
# Default to 'contents: read', which grants actions to read commits.
#
# If any permission is set, any permission not included in the list is
# implicitly set to "none".
#
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- 'master'
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
pull_request:
env:
GO_VERSION: "1.22.11"
TESTSTAT_VERSION: v0.1.25
DESTDIR: ./build
SETUP_BUILDX_VERSION: edge
SETUP_BUILDKIT_IMAGE: moby/buildkit:latest
DOCKER_EXPERIMENTAL: 1
jobs:
validate-dco:
uses: ./.github/workflows/.dco.yml
build:
runs-on: ubuntu-22.04-arm
timeout-minutes: 20 # guardrails timeout for the whole job
needs:
- validate-dco
strategy:
fail-fast: false
matrix:
target:
- binary
- dynbinary
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Build
uses: docker/bake-action@v6
with:
targets: ${{ matrix.target }}
-
name: List artifacts
run: |
tree -nh ${{ env.DESTDIR }}
-
name: Check artifacts
run: |
find ${{ env.DESTDIR }} -type f -exec file -e ascii -- {} +
build-dev:
runs-on: ubuntu-22.04-arm
timeout-minutes: 120 # guardrails timeout for the whole job
needs:
- validate-dco
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Build dev image
uses: docker/bake-action@v6
with:
targets: dev
set: |
*.cache-from=type=gha,scope=dev-arm64
*.cache-to=type=gha,scope=dev-arm64,mode=max
*.output=type=cacheonly
test-unit:
runs-on: ubuntu-22.04-arm
timeout-minutes: 120 # guardrails timeout for the whole job
needs:
- build-dev
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up runner
uses: ./.github/actions/setup-runner
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Build dev image
uses: docker/bake-action@v6
with:
targets: dev
set: |
dev.cache-from=type=gha,scope=dev-arm64
-
name: Test
run: |
make -o build test-unit
-
name: Prepare reports
if: always()
run: |
mkdir -p bundles /tmp/reports
find bundles -path '*/root/*overlay2' -prune -o -type f \( -name '*-report.json' -o -name '*.log' -o -name '*.out' -o -name '*.prof' -o -name '*-report.xml' \) -print | xargs sudo tar -czf /tmp/reports.tar.gz
tar -xzf /tmp/reports.tar.gz -C /tmp/reports
sudo chown -R $(id -u):$(id -g) /tmp/reports
tree -nh /tmp/reports
-
name: Send to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./bundles
env_vars: RUNNER_OS
flags: unit
token: ${{ secrets.CODECOV_TOKEN }} # used to upload coverage reports: https://github.com/moby/buildkit/pull/4660#issue-2142122533
-
name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-unit-arm64-graphdriver
path: /tmp/reports/*
retention-days: 1
test-unit-report:
runs-on: ubuntu-20.04
timeout-minutes: 10
continue-on-error: ${{ github.event_name != 'pull_request' }}
if: always()
needs:
- test-unit
steps:
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
-
name: Download reports
uses: actions/download-artifact@v4
with:
pattern: test-reports-unit-arm64-*
path: /tmp/reports
-
name: Install teststat
run: |
go install github.com/vearutop/teststat@${{ env.TESTSTAT_VERSION }}
-
name: Create summary
run: |
find /tmp/reports -type f -name '*-go-test-report.json' -exec teststat -markdown {} \+ >> $GITHUB_STEP_SUMMARY
test-integration:
runs-on: ubuntu-22.04-arm
timeout-minutes: 120 # guardrails timeout for the whole job
continue-on-error: ${{ github.event_name != 'pull_request' }}
needs:
- build-dev
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up runner
uses: ./.github/actions/setup-runner
-
name: Set up tracing
uses: ./.github/actions/setup-tracing
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Build dev image
uses: docker/bake-action@v6
with:
targets: dev
set: |
dev.cache-from=type=gha,scope=dev-arm64
-
name: Test
run: |
make -o build test-integration
env:
TEST_SKIP_INTEGRATION_CLI: 1
TESTCOVERAGE: 1
-
name: Prepare reports
if: always()
run: |
reportsPath="/tmp/reports/arm64-graphdriver"
mkdir -p bundles $reportsPath
find bundles -path '*/root/*overlay2' -prune -o -type f \( -name '*-report.json' -o -name '*.log' -o -name '*.out' -o -name '*.prof' -o -name '*-report.xml' \) -print | xargs sudo tar -czf /tmp/reports.tar.gz
tar -xzf /tmp/reports.tar.gz -C $reportsPath
sudo chown -R $(id -u):$(id -g) $reportsPath
tree -nh $reportsPath
curl -sSLf localhost:16686/api/traces?service=integration-test-client > $reportsPath/jaeger-trace.json
-
name: Send to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./bundles/test-integration
env_vars: RUNNER_OS
flags: integration
token: ${{ secrets.CODECOV_TOKEN }} # used to upload coverage reports: https://github.com/moby/buildkit/pull/4660#issue-2142122533
-
name: Test daemon logs
if: always()
run: |
cat bundles/test-integration/docker.log
-
name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-integration-arm64-graphdriver
path: /tmp/reports/*
retention-days: 1
test-integration-report:
runs-on: ubuntu-20.04
timeout-minutes: 10
continue-on-error: ${{ github.event_name != 'pull_request' }}
if: always()
needs:
- test-integration
steps:
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
-
name: Download reports
uses: actions/download-artifact@v4
with:
path: /tmp/reports
pattern: test-reports-integration-arm64-*
merge-multiple: true
-
name: Install teststat
run: |
go install github.com/vearutop/teststat@${{ env.TESTSTAT_VERSION }}
-
name: Create summary
run: |
find /tmp/reports -type f -name '*-go-test-report.json' -exec teststat -markdown {} \+ >> $GITHUB_STEP_SUMMARY

View File

@@ -104,16 +104,16 @@ jobs:
matrix:
platform: ${{ fromJson(needs.prepare.outputs.platforms) }}
steps:
-
name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
-
name: Download meta bake definition
uses: actions/download-artifact@v4
@@ -140,8 +140,9 @@ jobs:
-
name: Build
id: bake
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
source: .
files: |
./docker-bake.hcl
/tmp/bake-meta.json

View File

@@ -19,10 +19,11 @@ on:
branches:
- 'master'
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
pull_request:
env:
GO_VERSION: "1.22.10"
GO_VERSION: "1.22.11"
DESTDIR: ./build
SETUP_BUILDX_VERSION: latest
SETUP_BUILDKIT_IMAGE: moby/buildkit:latest
@@ -37,9 +38,6 @@ jobs:
needs:
- validate-dco
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@@ -49,7 +47,7 @@ jobs:
buildkitd-flags: --debug
-
name: Build
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: binary
-
@@ -145,8 +143,9 @@ jobs:
docker info
-
name: Build test image
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
source: .
workdir: ./buildkit
targets: integration-tests
set: |

View File

@@ -19,6 +19,7 @@ on:
branches:
- 'master'
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
pull_request:
env:
@@ -42,11 +43,6 @@ jobs:
- binary
- dynbinary
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@@ -56,7 +52,7 @@ jobs:
buildkitd-flags: --debug
-
name: Build
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: ${{ matrix.target }}
-
@@ -101,11 +97,6 @@ jobs:
matrix:
platform: ${{ fromJson(needs.prepare-cross.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Prepare
run: |
@@ -120,7 +111,7 @@ jobs:
buildkitd-flags: --debug
-
name: Build
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: all
set: |
@@ -143,11 +134,6 @@ jobs:
# required to check out the repository
contents: read
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@@ -157,7 +143,7 @@ jobs:
buildkitd-flags: --debug
-
name: Run
uses: docker/bake-action@v5
uses: docker/bake-action@v6
with:
targets: govulncheck
env:

View File

@@ -14,6 +14,7 @@ on:
branches:
- 'master'
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
tags:
- 'v*'
pull_request:
@@ -57,7 +58,7 @@ jobs:
- name: Update Go
uses: actions/setup-go@v5
with:
go-version: "1.22.10"
go-version: "1.22.11"
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:

View File

@@ -19,10 +19,11 @@ on:
branches:
- 'master'
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
pull_request:
env:
GO_VERSION: "1.22.10"
GO_VERSION: "1.22.11"
GIT_PAGER: "cat"
PAGER: "cat"
SETUP_BUILDX_VERSION: latest
@@ -50,9 +51,6 @@ jobs:
if [ "${{ matrix.mode }}" = "systemd" ]; then
echo "SYSTEMD=true" >> $GITHUB_ENV
fi
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@@ -62,7 +60,7 @@ jobs:
buildkitd-flags: --debug
-
name: Build dev image
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: dev
set: |
@@ -135,7 +133,7 @@ jobs:
buildkitd-flags: --debug
-
name: Build dev image
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: dev
set: |
@@ -177,9 +175,6 @@ jobs:
matrix:
platform: ${{ fromJson(needs.smoke-prepare.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Prepare
run: |
@@ -197,7 +192,7 @@ jobs:
buildkitd-flags: --debug
-
name: Test
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: binary-smoketest
set: |

View File

@@ -19,6 +19,7 @@ on:
branches:
- 'master'
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
pull_request:
jobs:

View File

@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1.7
ARG GO_VERSION=1.22.10
ARG GO_VERSION=1.22.11
ARG BASE_DEBIAN_DISTRO="bookworm"
ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
ARG XX_VERSION=1.6.1
@@ -8,12 +8,12 @@ ARG XX_VERSION=1.6.1
ARG VPNKIT_VERSION=0.5.0
ARG DOCKERCLI_REPOSITORY="https://github.com/docker/cli.git"
ARG DOCKERCLI_VERSION=v27.3.1
ARG DOCKERCLI_VERSION=v27.5.0
# cli version used for integration-cli tests
ARG DOCKERCLI_INTEGRATION_REPOSITORY="https://github.com/docker/cli.git"
ARG DOCKERCLI_INTEGRATION_VERSION=v17.06.2-ce
ARG BUILDX_VERSION=0.18.0
ARG COMPOSE_VERSION=v2.30.3
ARG BUILDX_VERSION=0.20.0
ARG COMPOSE_VERSION=v2.32.4
ARG SYSTEMD="false"
ARG DOCKER_STATIC=1
@@ -356,7 +356,7 @@ FROM base AS rootlesskit-src
WORKDIR /usr/src/rootlesskit
RUN git init . && git remote add origin "https://github.com/rootless-containers/rootlesskit.git"
# When updating, also update vendor.mod and hack/dockerfile/install/rootlesskit.installer accordingly.
ARG ROOTLESSKIT_VERSION=v2.3.1
ARG ROOTLESSKIT_VERSION=v2.3.2
RUN git fetch -q --depth 1 origin "${ROOTLESSKIT_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD
FROM base AS rootlesskit-build

View File

@@ -5,7 +5,7 @@
# This represents the bare minimum required to build and test Docker.
ARG GO_VERSION=1.22.10
ARG GO_VERSION=1.22.11
ARG BASE_DEBIAN_DISTRO="bookworm"
ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"

View File

@@ -161,7 +161,7 @@ FROM ${WINDOWS_BASE_IMAGE}:${WINDOWS_BASE_IMAGE_TAG}
# Use PowerShell as the default shell
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ARG GO_VERSION=1.22.10
ARG GO_VERSION=1.22.11
ARG GOTESTSUM_VERSION=v1.8.2
ARG GOWINRES_VERSION=v0.3.1
ARG CONTAINERD_VERSION=v1.7.25

162
Jenkinsfile vendored
View File

@@ -1,162 +0,0 @@
#!groovy
pipeline {
agent none
options {
buildDiscarder(logRotator(daysToKeepStr: '30'))
timeout(time: 2, unit: 'HOURS')
timestamps()
}
parameters {
booleanParam(name: 'arm64', defaultValue: true, description: 'ARM (arm64) Build/Test')
booleanParam(name: 'dco', defaultValue: true, description: 'Run the DCO check')
}
environment {
DOCKER_BUILDKIT = '1'
DOCKER_EXPERIMENTAL = '1'
DOCKER_GRAPHDRIVER = 'overlay2'
CHECK_CONFIG_COMMIT = '33a3680e08d1007e72c3b3f1454f823d8e9948ee'
TESTDEBUG = '0'
TIMEOUT = '120m'
}
stages {
stage('pr-hack') {
when { changeRequest() }
steps {
script {
echo "Workaround for PR auto-cancel feature. Borrowed from https://issues.jenkins-ci.org/browse/JENKINS-43353"
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) milestone(buildNumber - 1)
milestone(buildNumber)
}
}
}
stage('DCO-check') {
when {
beforeAgent true
expression { params.dco }
}
agent { label 'arm64 && ubuntu-2004' }
steps {
sh '''
docker run --rm \
-v "$WORKSPACE:/workspace" \
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \
alpine sh -c 'apk add --no-cache -q bash git openssh-client && git config --system --add safe.directory /workspace && cd /workspace && hack/validate/dco'
'''
}
}
stage('Build') {
parallel {
stage('arm64') {
when {
beforeAgent true
expression { params.arm64 }
}
agent { label 'arm64 && ubuntu-2004' }
environment {
TEST_SKIP_INTEGRATION_CLI = '1'
}
stages {
stage("Print info") {
steps {
sh 'docker version'
sh 'docker info'
sh '''
echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
&& bash ${WORKSPACE}/check-config.sh || true
'''
}
}
stage("Build dev image") {
steps {
sh 'docker build --force-rm -t docker:${GIT_COMMIT} .'
}
}
stage("Unit tests") {
steps {
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
--name docker-pr$BUILD_NUMBER \
-e DOCKER_EXPERIMENTAL \
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
-e DOCKER_GRAPHDRIVER \
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \
docker:${GIT_COMMIT} \
hack/test/unit
'''
}
post {
always {
junit testResults: 'bundles/junit-report*.xml', allowEmptyResults: true
}
}
}
stage("Integration tests") {
environment { TEST_SKIP_INTEGRATION_CLI = '1' }
steps {
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
--name docker-pr$BUILD_NUMBER \
-e DOCKER_EXPERIMENTAL \
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
-e DOCKER_GRAPHDRIVER \
-e TESTDEBUG \
-e TEST_INTEGRATION_USE_SNAPSHOTTER \
-e TEST_SKIP_INTEGRATION_CLI \
-e TIMEOUT \
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \
docker:${GIT_COMMIT} \
hack/make.sh \
dynbinary \
test-integration
'''
}
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
}
}
}
post {
always {
sh '''
echo "Ensuring container killed."
docker rm -vf docker-pr$BUILD_NUMBER || true
'''
sh '''
echo "Chowning /workspace to jenkins user"
docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
'''
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
sh '''
bundleName=arm64-integration
echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
'''
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
}
}
cleanup {
sh 'make clean'
deleteDir()
}
}
}
}
}
}
}

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# When updating, also update vendor.mod and Dockerfile accordingly.
: "${ROOTLESSKIT_VERSION:=v2.3.1}"
: "${ROOTLESSKIT_VERSION:=v2.3.2}"
install_rootlesskit() {
case "$1" in

View File

@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG GO_VERSION=1.22.10
ARG GO_VERSION=1.22.11
ARG BASE_DEBIAN_DISTRO="bookworm"
ARG PROTOC_VERSION=3.11.4

View File

@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG GO_VERSION=1.22.10
ARG GO_VERSION=1.22.11
ARG GOVULNCHECK_VERSION=v1.1.3
ARG FORMAT=text

View File

@@ -1,4 +1,4 @@
package network
package bridge
import (
"context"
@@ -19,7 +19,6 @@ import (
)
func TestCreateWithMultiNetworks(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.44"), "requires API v1.44")
ctx := setupTest(t)
@@ -49,9 +48,6 @@ func TestCreateWithMultiNetworks(t *testing.T) {
}
func TestCreateWithIPv6DefaultsToULAPrefix(t *testing.T) {
// On Windows, network creation fails with this error message: Error response from daemon: this request is not supported by the 'windows' ipam driver
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
ctx := setupTest(t)
apiClient := testEnv.APIClient()
@@ -73,7 +69,6 @@ func TestCreateWithIPv6DefaultsToULAPrefix(t *testing.T) {
}
func TestCreateWithIPv6WithoutEnableIPv6Flag(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows") // d.Start fails on Windows with `protocol not available`
ctx := setupTest(t)
d := daemon.New(t)
@@ -103,7 +98,6 @@ func TestCreateWithIPv6WithoutEnableIPv6Flag(t *testing.T) {
// Check that it's possible to create IPv6 networks with a 64-bit ip-range,
// in 64-bit and bigger subnets, with and without a gateway.
func Test64BitIPRange(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "no bridge or IPv6 on Windows")
ctx := setupTest(t)
c := testEnv.APIClient()
@@ -139,7 +133,6 @@ func Test64BitIPRange(t *testing.T) {
// Demonstrate a limitation of the IP address allocator, it can't
// allocate the last address in range that ends on a 64-bit boundary.
func TestIPRangeAt64BitLimit(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "no bridge or IPv6 on Windows")
ctx := setupTest(t)
c := testEnv.APIClient()

View File

@@ -0,0 +1,56 @@
package bridge // import "github.com/docker/docker/integration/network/bridge"
import (
"context"
"os"
"testing"
"github.com/docker/docker/testutil"
"github.com/docker/docker/testutil/environment"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/codes"
)
var (
testEnv *environment.Execution
baseContext context.Context
)
func TestMain(m *testing.M) {
shutdown := testutil.ConfigureTracing()
ctx, span := otel.Tracer("").Start(context.Background(), "integration/network/bridge.TestMain")
baseContext = ctx
var err error
testEnv, err = environment.New(ctx)
if err != nil {
span.SetStatus(codes.Error, err.Error())
span.End()
shutdown(ctx)
panic(err)
}
err = environment.EnsureFrozenImagesLinux(ctx, testEnv)
if err != nil {
span.SetStatus(codes.Error, err.Error())
span.End()
shutdown(ctx)
panic(err)
}
testEnv.Print()
code := m.Run()
if code != 0 {
span.SetStatus(codes.Error, "m.Run() returned non-zero exit code")
}
span.End()
shutdown(ctx)
os.Exit(code)
}
func setupTest(t *testing.T) context.Context {
ctx := testutil.StartSpan(baseContext, t)
environment.ProtectAll(ctx, t, testEnv)
t.Cleanup(func() { testEnv.Clean(ctx, t) })
return ctx
}

View File

@@ -0,0 +1,66 @@
package bridge
import (
"testing"
"github.com/docker/docker/integration/internal/network"
"github.com/docker/docker/libnetwork/drivers/bridge"
"github.com/docker/docker/testutil/daemon"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
// TestNetworkInitError checks that, if the default bridge network can't be restored on startup,
// it doesn't prevent the daemon from starting once the underlying problem is resolved.
// Regression test for https://github.com/moby/moby/issues/49291
func TestNetworkInitErrorDocker0(t *testing.T) {
d := daemon.New(t)
d.Start(t)
defer func() {
_ = d.StopWithError()
}()
const brName = "docker0"
d.SetEnvVar("DOCKER_TEST_BRIDGE_INIT_ERROR", brName)
err := d.RestartWithError()
assert.Assert(t, is.ErrorContains(err, "daemon exited during startup"))
d.SetEnvVar("DOCKER_TEST_BRIDGE_INIT_ERROR", "")
d.Start(t)
}
// TestNetworkInitErrorUserDefined is equivalent to TestNetworkInitErrorDocker0, for a
// user-defined network. But, the daemon doesn't try to delete a user-defined network
// and the daemon will still start if it can't be restored on startup. So, try to
// delete the network when it's failed to initialise, and check that it can be
// re-created when the initialisation problem has been resolved.
func TestNetworkInitErrorUserDefined(t *testing.T) {
ctx := setupTest(t)
d := daemon.New(t)
d.Start(t)
defer func() {
_ = d.StopWithError()
}()
c := d.NewClientT(t)
defer c.Close()
const netName = "testnet"
const brName = "br-" + netName
network.CreateNoError(ctx, t, c, netName,
network.WithOption(bridge.BridgeName, brName),
)
defer network.RemoveNoError(ctx, t, c, netName)
d.SetEnvVar("DOCKER_TEST_BRIDGE_INIT_ERROR", brName)
d.Restart(t)
err := c.NetworkRemove(ctx, netName)
assert.NilError(t, err)
d.SetEnvVar("DOCKER_TEST_BRIDGE_INIT_ERROR", "")
d.Restart(t)
network.CreateNoError(ctx, t, c, netName,
network.WithOption(bridge.BridgeName, brName),
)
}

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"net"
"net/netip"
"os"
"strconv"
"sync"
@@ -904,6 +905,13 @@ func (d *driver) createNetwork(config *networkConfiguration) (err error) {
// Apply the prepared list of steps, and abort at the first error.
bridgeSetup.queueStep(setupDeviceUp)
if v := os.Getenv("DOCKER_TEST_BRIDGE_INIT_ERROR"); v == config.BridgeName {
bridgeSetup.queueStep(func(n *networkConfiguration, b *bridgeInterface) error {
return fmt.Errorf("DOCKER_TEST_BRIDGE_INIT_ERROR is %q", v)
})
}
return bridgeSetup.apply()
}
@@ -923,6 +931,18 @@ func (d *driver) deleteNetwork(nid string) error {
d.Unlock()
if !ok {
// If the network was successfully created by an earlier incarnation of the daemon,
// but it failed to initialise this time, the network is still in the store (in
// case whatever caused the failure can be fixed for a future daemon restart). But,
// it's not in d.networks. To prevent the driver's state from getting out of step
// with its parent, make sure it's not in the store before reporting that it does
// not exist.
if err := d.storeDelete(&networkConfiguration{ID: nid}); err != nil && err != datastore.ErrKeyNotFound {
log.G(context.TODO()).WithFields(log.Fields{
"error": err,
"network": nid,
}).Warnf("Failed to delete network from bridge store")
}
return types.InternalMaskableErrorf("network %s does not exist", nid)
}

View File

@@ -54,7 +54,18 @@ func loadBridgeNetFilterModule(fullPath string) error {
}
// Enable bridge net filtering if not already enabled. See GitHub issue #11404
func enableBridgeNetFiltering(nfParam string) error {
func enableBridgeNetFiltering(nfParam string) (retErr error) {
defer func() {
if retErr != nil {
if os.Getenv("DOCKER_IGNORE_BR_NETFILTER_ERROR") == "1" {
log.G(context.TODO()).WithError(retErr).Warnf("Continuing without enabling br_netfilter")
retErr = nil
return
}
retErr = fmt.Errorf("%w: set environment variable DOCKER_IGNORE_BR_NETFILTER_ERROR=1 to ignore", retErr)
}
}()
if err := loadBridgeNetFilterModule(nfParam); err != nil {
return fmt.Errorf("cannot restrict inter-container communication or run without the userland proxy: %w", err)
}
@@ -68,7 +79,7 @@ func enableBridgeNetFiltering(nfParam string) error {
}
err = errors.New("ensure that the br_netfilter kernel module is loaded")
}
return fmt.Errorf("cannot restrict inter-container communication: %v", err)
return fmt.Errorf("cannot restrict inter-container communication or run without the userland proxy: %v", err)
}
if !enabled {
return os.WriteFile(nfParam, []byte{'1', '\n'}, 0o644)

View File

@@ -10,6 +10,7 @@ import (
"os/exec"
"os/user"
"path/filepath"
"slices"
"strconv"
"strings"
"syscall"
@@ -829,6 +830,17 @@ func (d *Daemon) ReloadConfig() error {
return nil
}
// SetEnvVar updates the set of extra env variables for the daemon, to take
// effect on the next start/restart.
func (d *Daemon) SetEnvVar(name, val string) {
prefix := name + "="
if idx := slices.IndexFunc(d.extraEnv, func(ev string) bool { return strings.HasPrefix(ev, prefix) }); idx > 0 {
d.extraEnv[idx] = prefix + val
return
}
d.extraEnv = append(d.extraEnv, prefix+val)
}
// LoadBusybox image into the daemon
func (d *Daemon) LoadBusybox(ctx context.Context, t testing.TB) {
t.Helper()