Commit graph

46342 commits

Author SHA1 Message Date
Sebastiaan van Stijn
b7c5385b81
update to go1.20.7
Includes a fix for CVE-2023-29409

go1.20.7 (released 2023-08-01) includes a security fix to the crypto/tls
package, as well as bug fixes to the assembler and the compiler. See the
Go 1.20.7 milestone on our issue tracker for details:

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

From the mailing list announcement:

[security] Go 1.20.7 and Go 1.19.12 are released

Hello gophers,

We have just released Go versions 1.20.7 and 1.19.12, minor point releases.

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

- crypto/tls: restrict RSA keys in certificates to <= 8192 bits

  Extremely large RSA keys in certificate chains can cause a client/server
  to expend significant CPU time verifying signatures. Limit this by
  restricting the size of RSA keys transmitted during handshakes to <=
  8192 bits.

  Based on a survey of publicly trusted RSA keys, there are currently only
  three certificates in circulation with keys larger than this, and all
  three appear to be test certificates that are not actively deployed. It
  is possible there are larger keys in use in private PKIs, but we target
  the web PKI, so causing breakage here in the interests of increasing the
  default safety of users of crypto/tls seems reasonable.

  Thanks to Mateusz Poliwczak for reporting this issue.

View the release notes for more information:
https://go.dev/doc/devel/release#go1.20.7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d5cb7cdeae)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-01 23:47:48 +02:00
Sebastiaan van Stijn
ba9875c2f5
Merge pull request #46120 from thaJeztah/24.0_backport_bump_gotest_tools
[24.0 backport] vendor: gotest.tools/v3 v3.5.0
2023-08-01 16:27:57 +02:00
Sebastiaan van Stijn
2ef88a3cbf
Merge pull request #46115 from thaJeztah/24.0_backport_fix_filter_errors
[24.0 backport] api/types/filters: fix errors not being matched by errors.Is()
2023-08-01 10:22:48 +02:00
Akihiro Suda
e426ae045b
Merge pull request #46103 from thaJeztah/24.0_backport_update_containerd_binary_1.7.3
[24.0 backport] update containerd binary to v1.7.3
2023-07-30 11:05:33 +09:00
Sebastiaan van Stijn
6be708aa7d
vendor: gotest.tools/v3 v3.5.0
- go.mod: update dependencies and go version by
- Use Go1.20
- Fix couple of typos
- Added `WithStdout` and `WithStderr` helpers
- Moved `cmdOperators` handling from `RunCmd` to `StartCmd`
- Deprecate `assert.ErrorType`
- Remove outdated Dockerfile
- add godoc links

full diff: https://github.com/gotestyourself/gotest.tools/compare/v3.4.0...v3.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ce053a14aa)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-29 20:53:54 +02:00
Sebastiaan van Stijn
b6568d2dd5
api/types/filters: fix errors not being matched by errors.Is()
I found that the errors returned weren't matched with `errors.Is()` when
wrapped.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 490fee7d45)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-29 16:25:07 +02:00
Sebastiaan van Stijn
02241b05fc
update containerd binary to v1.7.3
- full diff: https://github.com/containerd/containerd/compare/v1.7.2...v1.7.3
- release notes: https://github.com/containerd/containerd/releases/tag/v1.7.3

----

Welcome to the v1.7.3 release of containerd!

The third patch release for containerd 1.7 contains various fixes and updates.

Notable Updates

- RunC: Update runc binary to v1.1.8
- CRI: Fix `additionalGids`: it should fallback to `imageConfig.User`
  when `securityContext.RunAsUser`,`RunAsUsername` are empty
- CRI: write generated CNI config atomically
- Port-Forward: Correctly handle known errors
- Resolve docker.NewResolver race condition
- Fix `net.ipv4.ping_group_range` with userns
- Runtime/V2/RunC: handle early exits w/o big locks
- SecComp: always allow `name_to_handle_at`
- CRI: Windows Pod Stats: Add a check to skip stats for containers that
  are not running
- Task: don't `close()` io before cancel()
- Remove CNI conf_template deprecation
- Fix issue for HPC pod metrics

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit bf48d3ec29)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-28 13:24:19 +02:00
Sebastiaan van Stijn
3a6899c6fd
update containerd binary to v1.7.2
- full diff: https://github.com/containerd/containerd/compare/v1.7.1...v1.7.2
- release notes: https://github.com/containerd/containerd/releases/tag/v1.7.2

----

Welcome to the v1.7.2 release of containerd!

The second patch release for containerd 1.7 includes enhancements to CRI
sandbox mode, Windows snapshot mounting support, and CRI and container IO
bug fixes.

CRI/Sandbox Updates

- Publish sandbox events
- Make stats respect sandbox's platform

Other Notable Updates

- Mount snapshots on Windows
- Notify readiness when registered plugins are ready
- Fix `cio.Cancel()` should close pipes
- CDI: Use CRI `Config.CDIDevices` field for CDI injection

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a78381c399)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-28 13:24:18 +02:00
Sebastiaan van Stijn
77e2d29b8a
Merge pull request #46095 from vvoland/c8d-refreshimage-refactor-24
[24.0 backport] daemon/list: Refactor refreshImage and make `readConfig` return errdefs
2023-07-28 13:11:43 +02:00
Sebastiaan van Stijn
9e5726d3de
Merge pull request #46097 from vvoland/c8d-missing-config-24
[24.0 backport] c8d/container: Follow snapshot parents for size calculation
2023-07-28 11:50:19 +02:00
Paweł Gronowski
7927cae910
c8d/container: Follow snapshot parents for size calculation
Refactor GetContainerLayerSize to calculate unpacked image size only by
following the snapshot parent tree directly instead of following it by
using diff ids from image config.

This works even if the original manifest/config used to create that
container is no longer present in the content store.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 4d8e3f54cc)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-07-28 10:30:54 +02:00
Paweł Gronowski
45ba926c6d
daemon/list: Drop unused arg from containerReducer
refreshImage is the only function used as a reducer and it doesn't use
the `filter *listContext`.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 13180c1c49)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-07-28 10:21:04 +02:00
Paweł Gronowski
6c4121a943
daemon/list: Refactor refreshImage
Add context comments and make it a bit more readable.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 68991ae240)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-07-28 10:21:00 +02:00
Paweł Gronowski
fcb68e55fa
daemon/list: Replace ErrImageDoesNotExist check
Check for generic `errdefs.NotFound` rather than specific error helper
struct when checking if the error is caused by the image not being
present.
It still works for `ErrImageDoesNotExist` because it
implements the NotFound errdefs interface too.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 5a39bee635)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-07-28 09:49:06 +02:00
Paweł Gronowski
3029f554cc
c8d/readConfig: Translate c8d NotFound to errdefs
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 7379d18018)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-07-28 09:49:02 +02:00
Sebastiaan van Stijn
b76ffecee8
Merge pull request #46061 from vvoland/integration-no-fail-fast-24
[24.0 backport] hack/integration: Add TEST_INTEGRATION_FAIL_FAST
2023-07-24 20:54:12 +02:00
Bjorn Neergaard
96a2b214cb
Merge pull request #46045 from thaJeztah/24.0_backport_bump_buildkit_0.11
[24.0 backport] vendor: github.com/moby/buildkit v0.11.7-dev
2023-07-24 09:27:46 -06:00
Paweł Gronowski
35a8b00b18
hack/integration: Add TEST_INTEGRATION_FAIL_FAST
Before this change, integration test would fail fast and not execute all
test suites when one suite fails.
Change this behavior into opt-in enabled by TEST_INTEGRATION_FAIL_FAST
variable.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 48cc28e4ef)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-07-24 17:05:44 +02:00
Sebastiaan van Stijn
fed26d5b3c
vendor: github.com/moby/buildkit v0.11.7-dev
full diff: 0a15675913...616c3f613b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0ec73a7892)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-24 16:14:03 +02:00
Bjorn Neergaard
a61e2b4c9c
Merge pull request #46044 from neersighted/init_cleanup_24.0
[24.0 backport] Upstart & sysvinit cleanup
2023-07-21 12:06:26 -06:00
Tianon Gravi
eede7f09c7
Remove Upstart scripts
Upstart has been EOL for 8 years and isn't used by any distributions we support any more.

Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
(cherry picked from commit 0d8087fbbc)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-07-21 11:00:50 -06:00
Tianon Gravi
907f838603
Remove Upstart and cgroups bits from Debian sysvinit script
Upstart has been EOL for 8 years and isn't used by any distributions we support any more.

Additionally, this removes the "cgroups v1" setup code because it's more reasonable now for us to expect something _else_ to have set up cgroups appropriately (especially cgroups v2).

Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
(cherry picked from commit ae737656f9)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-07-21 11:00:40 -06:00
Sebastiaan van Stijn
52c92be4c5
Merge pull request #46029 from thaJeztah/24.0_backport_bump_runc_binary_1.1.8
[24.0 backport] Dockerfile: update runc binary to v1.1.8
2023-07-19 19:18:38 +02:00
Sebastiaan van Stijn
f022632503
Dockerfile: update runc binary to v1.1.8
release notes: https://github.com/opencontainers/runc/releases/tag/v1.1.8
full diff: https://github.com/opencontainers/runc/compare/v1.1.7...v1.1.9

This is the eighth patch release of the 1.1.z release branch of runc.
The most notable change is the addition of RISC-V support, along with a
few bug fixes.

- Support riscv64.
- init: do not print environment variable value.
- libct: fix a race with systemd removal.
- tests/int: increase num retries for oom tests.
- man/runc: fixes.
- Fix tmpfs mode opts when dir already exists.
- docs/systemd: fix a broken link.
- ci/cirrus: enable some rootless tests on cs9.
- runc delete: call systemd's reset-failed.
- libct/cg/sd/v1: do not update non-frozen cgroup after frozen failed.
- CI: bump Fedora, Vagrant, bats.
- .codespellrc: update for 2.2.5.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit df86d855f5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:22:48 +02:00
Sebastiaan van Stijn
bd41493132
Merge pull request #46023 from thaJeztah/24.0_backport_bump_buildx
[24.0 backport] Dockerfile: update buildx to v0.11.2
2023-07-19 16:58:47 +02:00
Sebastiaan van Stijn
5164e5f6d6
Merge pull request #46025 from vvoland/c8d-inspect-variant-24
[24.0 backport] c8d/inspect: Include platform Variant
2023-07-19 15:33:46 +02:00
Sebastiaan van Stijn
2b2a72cc65
Merge pull request #46021 from thaJeztah/24.0_backport_c8d-image-save-lease
[24.0 backport] c8d: Make sure the content isn't removed while we export
2023-07-19 13:06:14 +02:00
Paweł Gronowski
98a6422cbc
c8d/inspect: Include platform Variant
Variant was mistakenly omitted in the returned V1Image.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 2659f7f740)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-07-19 13:06:11 +02:00
Sebastiaan van Stijn
aab94fb340
Dockerfile: update buildx to v0.11.2
Update the BUILDX_VERSION :)

release notes:

- https://github.com/docker/buildx/releases/tag/v0.11.1
- https://github.com/docker/buildx/releases/tag/v0.11.2

full diff: https://github.com/docker/buildx/compare/v0.11.0...v0.11.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d78893921a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 13:04:31 +02:00
Djordje Lukic
1be48ec553
c8d: Make sure the content isn't removed while we export
This change add leases for all the content that will be exported, once
the image(s) are exported the lease is removed, thus letting
containerd's GC to do its job if needed. This fixes the case where
someone would remove an image that is still being exported.

This fixes the TestAPIImagesSaveAndLoad cli integration test.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
(cherry picked from commit f3a6b0fd08)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 11:57:49 +02:00
Sebastiaan van Stijn
d4a26c1530
Merge pull request #46013 from vvoland/c8d-resolve-fix-digested-and-named-24
[24.0 backport] c8d/resolveImage: Fix Digested and Named reference
2023-07-19 00:12:49 +02:00
Bjorn Neergaard
d63f7fb201
Merge pull request #46010 from thaJeztah/24.0_backport_buildkit_ref_replace
[24.0 backport] ci: extract buildkit version correctly with replace-d modules
2023-07-18 13:14:04 -06:00
Sebastiaan van Stijn
4f0747b0df
Merge pull request #46014 from vvoland/c8d-inspect-fix-duplicate-digested-24
[backport 24.0] c8d/inspect: Don't duplicate digested ref
2023-07-18 20:19:57 +02:00
Bjorn Neergaard
ff0144de3b
ci(buildkit): remove early-return from buildkit-ref
This doesn't really make sense now that this script returns a
$GITHUB_ENV snippet.

Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
(cherry picked from commit 7310a7cd0c)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-07-18 12:11:56 -06:00
Bjorn Neergaard
a936ae7e98
ci(buildkit): remove misleading code from buildkit-ref
Post-f8c0d92a22bad004cb9cbb4db704495527521c42, BUILDKIT_REPO doesn't
really do what it claims to. Instead, don't allow overloading since the
import path for BuildKit is always the same, and make clear the
provenance of values when generating the final variable definitions.

We also better document the script, and follow some best practices for
both POSIX sh and Bash.

Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
(cherry picked from commit 4ecc01f3ad)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-07-18 12:11:55 -06:00
Bjorn Neergaard
4c29864b02
hack/with-go-mod.sh: warn on stderr
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
(cherry picked from commit 48ff8a95cc)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-07-18 12:11:54 -06:00
Paweł Gronowski
3c5c192baf
c8d/resolveImage: Fix Digested and Named reference
When resolving a reference that is both a Named and Digested, it could
be resolved to an image that has the same digest, but completely
different repository name.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 48fc306764fc5c39d4284021520a0337ef7e0cb0)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-07-18 18:02:36 +02:00
Paweł Gronowski
572de8764e
c8d/inspect: Don't duplicate digested ref
If image name is already an untagged digested reference, don't produce
additional digested ref.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 028eab9ebb)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-07-18 17:48:35 +02:00
Justin Chadwell
5dded3340c
ci: extract buildkit version correctly with replace-d modules
Signed-off-by: Justin Chadwell <me@jedevc.com>
(cherry picked from commit f8c0d92a22)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-18 15:23:57 +02:00
Sebastiaan van Stijn
8b24eea65e
Merge pull request #45990 from thaJeztah/24.0_backport_hijack_share_request_builder
[24.0 backport] client: Client.postHijacked: use Client.buildRequest
2023-07-18 15:05:20 +02:00
Sebastiaan van Stijn
8ab6d025f6
Merge pull request #46001 from thaJeztah/24.0_backport_notestyourself
[24.0 backport] quota: remove gotest.tools from testhelpers
2023-07-18 10:24:21 +02:00
Sebastiaan van Stijn
bd1ae65aab
quota: remove gotest.tools from testhelpers
gotest.tools has an init() which registers a '-update' flag;
a80f057529/internal/source/update.go (L21-L23)

The quota helper contains a testhelpers file, which is meant for usage
in (integration) tests, but as it's in the same pacakge as production
code, would also trigger the gotest.tools init.

This patch removes the gotest.tools code from this file.

Before this patch:

    $ (exec -a libnetwork-setkey "$(which dockerd)" -help)
    Usage of libnetwork-setkey:
      -exec-root string
            docker exec root (default "/run/docker")
      -update
            update golden values

With this patch applied:

    $ (exec -a libnetwork-setkey "$(which dockerd)" -help)
    Usage of libnetwork-setkey:
      -exec-root string
            docker exec root (default "/run/docker")

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1aa17222e7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-17 23:12:28 +02:00
Sebastiaan van Stijn
2e3f3fd1e0
Merge pull request #45998 from neersighted/backport/45997/24.0
[24.0 backport] Build system grab-bag
2023-07-17 20:19:50 +02:00
Bjorn Neergaard
544032f7a4
hack/d/cli.sh: properly handle errors in curl
Add `-f` to output nothing to tar if the curl fails, and `-S` to report
errors if they happen.

Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
(cherry picked from commit 780e8b2332)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-07-17 11:23:13 -06:00
Bjorn Neergaard
0df2e1bdd8
Dockerfile: improve CLI/rootlesskit caching
Use bind-mounts instead of a `COPY` for cli.sh, and use `COPY --link`
for rootlesskit's build stage.

Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
(cherry picked from commit 12a19dcd84)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-07-17 11:23:12 -06:00
Bjorn Neergaard
05f82fdd00
Dockerfile(.simple): align APT_MIRROR support
Use a non-slash escape sequence to support mirrors with a path
component, and do not unconditionally replace the mirror in
Dockerfile.simple.

Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
(cherry picked from commit 235cd6c6b2)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-07-17 11:23:11 -06:00
Bjorn Neergaard
151686a5c8
Makefile: pass through APT_MIRROR
This aligns `docker build` as invoked by the Makefile with both `docker
buildx bake` as invoked by the Makefile and directly by the user.

Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
(cherry picked from commit bcea83ab9b)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-07-17 11:23:10 -06:00
CrazyMax
31567e0973
Dockerfile: use default apt mirrors
Use default apt mirrors and also check APT_MIRROR
is set before updating mirrors.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit a1d2132bf6)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-07-17 11:23:05 -06:00
Sebastiaan van Stijn
d94f2dcab2
client: Client.postHijacked: use Client.buildRequest
Use Client.buildRequest instead of a local copy of the same logic so
that we're using the same logic, and there's less chance of diverging.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c219b09d4a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-17 09:41:41 +02:00
Sebastiaan van Stijn
bff68bf2cc
client: Client.setupHijackConn: explicitly ignore errors
Just making my IDE and some linters slightly happier.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e11555218b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-17 09:41:41 +02:00