Commit Graph

49923 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
7263cd226f image/tarexport: saveSession.save: inline variables
Remove some intermediate variables that were only used in a single place.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-10 11:52:48 +02:00
Sebastiaan van Stijn
2e4079ff31 image/tarexport: saveSession.save: remove redundant Platform
Commit 9160b9fda6 removed the platform from
the descriptor, but this field was still used further in the code, and now
always taking an empty platform.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-10 11:48:57 +02:00
Sebastiaan van Stijn
ab5c5df1d5 image/tarexport: rename variables that shadowed imports
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-10 11:48:23 +02:00
Sebastiaan van Stijn
29f4a79edd Merge pull request #48456 from tonistiigi/buildkit-v0.16.0-rc2
vendor: update buildkit to v0.16.0-rc2
2024-09-10 09:56:54 +02:00
Tonis Tiigi
6f37e5a168 vendor: update buildkit to v0.16.0-rc2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-09-09 16:36:22 -07:00
Tõnis Tiigi
34182f6202 Merge pull request #48309 from crazy-max/buildkit-0.16.0-rc1
vendor: update buildkit to v0.16.0-rc1
2024-09-09 16:32:13 -07:00
Sebastiaan van Stijn
3174616aaf Merge pull request #48453 from thaJeztah/fix_package_doc
internal/unix_noeintr: fix godoc for package
2024-09-09 22:13:26 +02:00
Albin Kerouanton
0d91e80dbb Merge pull request #48435 from thaJeztah/stream_errorsjoin
container/stream: Config.CloseStreams(): use errors.Join
2024-09-09 21:48:32 +02:00
Sebastiaan van Stijn
5c96ed4109 Merge pull request #48450 from vvoland/binimage-relbranch
gha/bin-image: Also run on branches like `27.x`
2024-09-09 21:18:46 +02:00
Sebastiaan van Stijn
16d686c7bc internal/unix_noeintr: fix godoc for package
Put the comment in the expected format :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-09 19:32:11 +02:00
Paweł Gronowski
47d5ce0ef8 gha/bin-image: Also run on branches like 27.x
We moved to the major release branches with a `.x` suffix and forgot to
adjust this workflow.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-09-09 18:55:42 +02:00
Sebastiaan van Stijn
6b617699c5 Merge pull request #48434 from thaJeztah/more_gocompat
add more //go:build directives to prevent downgrading to go1.16
2024-09-09 12:34:56 +02:00
Sebastiaan van Stijn
fb6da4f4b7 daemon/logger/loggerutils: add //go:build directives to prevent downgrading to go1.16
commit 77f2d90e27 introduced the slices import,
which uses generics, but failed to add the go:build directives.

    # github.com/docker/docker/daemon/logger/loggerutils
    ../../daemon/logger/loggerutils/logfile.go:770:2: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-06 23:06:20 +02:00
Sebastiaan van Stijn
5403e3f4de libnetwork/networkdb: add //go:build directives to prevent downgrading to go1.16
commit 2847c4b7fe switched networkdb to use
go-immutable-radix v2, which uses generics, but failed to add the go:build
directives.

    # github.com/docker/docker/libnetwork/networkdb
    ../../libnetwork/networkdb/networkdb.go:47:19: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    ../../libnetwork/networkdb/networkdb.go:259:33: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    ../../libnetwork/networkdb/networkdb.go:269:25: function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    ../../libnetwork/networkdb/networkdb.go:270:27: function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-06 23:06:20 +02:00
Sebastiaan van Stijn
928e5aa524 container/stream: Config.CloseStreams(): use errors.Join
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-06 22:44:28 +02:00
Laura Brehm
96898c8be6 Merge pull request #48393 from NathanBaulch/typos
Fix typos
2024-09-06 15:28:11 +01:00
Nathan Baulch
59eba0ae13 Fix typos
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-06 21:53:09 +10:00
Sebastiaan van Stijn
a22a2875a1 Merge pull request #48432 from vvoland/update-go
update to go1.22.7
2024-09-06 11:57:11 +02:00
Paweł Gronowski
a2e14dd8bd update to go1.22.7
- https://github.com/golang/go/issues?q=milestone%3AGo1.22.7+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.22.6...go1.22.7

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

- go/parser: stack exhaustion in all Parse* functions

    Calling any of the Parse functions on Go source code which contains deeply nested literals can cause a panic due to stack exhaustion.

    This is CVE-2024-34155 and Go issue https://go.dev/issue/69138.

- encoding/gob: stack exhaustion in Decoder.Decode

    Calling Decoder.Decode on a message which contains deeply nested structures can cause a panic due to stack exhaustion.

    This is a follow-up to CVE-2022-30635.

    Thanks to Md Sakib Anwar of The Ohio State University (anwar.40@osu.edu) for reporting this issue.

    This is CVE-2024-34156 and Go issue https://go.dev/issue/69139.

- go/build/constraint: stack exhaustion in Parse

    Calling Parse on a "// +build" build tag line with deeply nested expressions can cause a panic due to stack exhaustion.

    This is CVE-2024-34158 and Go issue https://go.dev/issue/69141.

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

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-09-05 17:47:03 +02:00
CrazyMax
5ebc179cb1 test: update since session signature has changed
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-09-04 16:36:09 +02:00
CrazyMax
f4261dbb75 vendor: update buildkit to v0.16.0-rc1
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-09-04 16:36:09 +02:00
Paweł Gronowski
0b9779f7cc Merge pull request #48425 from thaJeztah/vendor_runc_1.1.14
vendor: github.com/opencontainers/runc v1.1.14
2024-09-04 08:54:03 +00:00
Sebastiaan van Stijn
fa734fe3d2 Merge pull request #48421 from thaJeztah/make_update_link
hack/make/.binary: enable pie mode on windows/arm64
2024-09-03 23:08:17 +02:00
Brian Goff
55752bb1ec Merge pull request #47983 from cpuguy83/skip_corrupted_log_files
Make log reading more robust to errors
2024-09-03 08:58:08 -07:00
Sebastiaan van Stijn
f9bac835b4 Merge pull request #48424 from thaJeztah/bump_runc_1.1.14
update runc binary to 1.1.14
2024-09-03 16:11:29 +02:00
Sebastiaan van Stijn
b5ec31f090 vendor: github.com/opencontainers/runc v1.1.14
diff: https://github.com/opencontainers/runc/compare/v1.1.13...v1.1.14

Release Notes:

- Fix CVE-2024-45310 / GHSA-jfvp-7x6p-h2pv, a low-severity attack that allowed maliciously configured containers to create empty files and directories on the host.
- Add support for Go 1.23.
- Revert "allow overriding VERSION value in Makefile" and add EXTRA_VERSION.
- rootfs: consolidate mountpoint creation logic.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-03 13:58:23 +02:00
Sebastiaan van Stijn
2189aa2426 update runc binary to 1.1.14
Update the runc binary that's used in CI and for the static packages.

diff: https://github.com/opencontainers/runc/compare/v1.1.13...v1.1.14

Release Notes:

- Fix CVE-2024-45310, a low-severity attack that allowed maliciously configured containers to create empty files and directories on the host.
- Add support for Go 1.23.
- Revert "allow overriding VERSION value in Makefile" and add EXTRA_VERSION.
- rootfs: consolidate mountpoint creation logic.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-03 13:30:19 +02:00
Paweł Gronowski
5213a5afe7 Merge pull request #48422 from vvoland/docs-api-147
docs/api: add documentation for API v1.47
2024-09-03 10:57:27 +00:00
Paweł Gronowski
4e0d1dfc17 docs/api: add documentation for API v1.47
API version used by the v27.2.0 release.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-09-03 11:58:17 +02:00
Sebastiaan van Stijn
d000f12fcc hack/make/.binary: enable pie mode on windows/arm64
pie-mode is supported for windows/arm64 since https://go.dev/cl/452415,
which is part of go1.20. Also update link to Go source for pie-mode support
to match the location for current versions of Go because the package was
moved in https://go.dev/cl/438475.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-03 10:24:00 +02:00
Sebastiaan van Stijn
6acf01366c Merge pull request #46982 from thaJeztah/update_go_1.22
update to go1.22.6
2024-09-02 18:23:36 +02:00
Paweł Gronowski
0473cfa0bd Merge pull request #48414 from vvoland/c8d-pull-msg
c8d/pull: Same error message for non-matching platform
2024-09-02 14:38:48 +00:00
Paweł Gronowski
c7f8557310 c8d/pull: Same error message for non-matching platform
Use the same error message as the graphdrivers image store backend.
It's more informative as it also includes the requested platform and
won't break clients checking doing error check with string-matching.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-09-02 13:30:12 +02:00
Sebastiaan van Stijn
f5108e9c6b golangci-lint: temporarily disable G115: integer overflow conversion
it produces many hits, some of which may be false positives, but we need to
look into these, e.g.;

    container/container.go:517:72: G115: integer overflow conversion int -> uint32 (gosec)
        shouldRestart, _, _ := container.RestartManager().ShouldRestart(uint32(container.ExitCode()), container.HasBeenManuallyStopped, container.FinishedAt.Sub(container.StartedAt))
                                                                              ^
    container/view.go:401:25: G115: integer overflow conversion int -> uint16 (gosec)
                        PrivatePort: uint16(p),
                                           ^
    container/view.go:413:25: G115: integer overflow conversion int -> uint16 (gosec)
                        PrivatePort: uint16(p),
                                           ^
    container/view.go:414:25: G115: integer overflow conversion int -> uint16 (gosec)
                        PublicPort:  uint16(h),
                                           ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-02 12:50:49 +02:00
Sebastiaan van Stijn
9b11bb507b update golangci-lint to v1.60.2
Update to add go1.23 support

full diff: https://github.com/golangci/golangci-lint/compare/v1.59.1...v1.60.2
Changelog: https://golangci-lint.run/product/changelog/#1602

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-02 12:47:54 +02:00
Sebastiaan van Stijn
3df59c9dcf update to go1.22.6
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-02 12:47:48 +02:00
Cory Snider
4cd5c2b643 hack/make/.binary: set CGO_LDFLAGS=-latomic for arm/v5
cross-compiling for arm/v5 was failing;

    #56 84.12 /usr/bin/arm-linux-gnueabi-clang -marm -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-759578347/go.o /tmp/go-link-759578347/000000.o /tmp/go-link-759578347/000001.o /tmp/go-link-759578347/000002.o /tmp/go-link-759578347/000003.o /tmp/go-link-759578347/000004.o /tmp/go-link-759578347/000005.o /tmp/go-link-759578347/000006.o /tmp/go-link-759578347/000007.o /tmp/go-link-759578347/000008.o /tmp/go-link-759578347/000009.o /tmp/go-link-759578347/000010.o /tmp/go-link-759578347/000011.o /tmp/go-link-759578347/000012.o /tmp/go-link-759578347/000013.o /tmp/go-link-759578347/000014.o /tmp/go-link-759578347/000015.o /tmp/go-link-759578347/000016.o /tmp/go-link-759578347/000017.o /tmp/go-link-759578347/000018.o -O2 -g -O2 -g -O2 -g -lpthread -O2 -g -no-pie -static
    #56 84.12 ld.lld: error: undefined symbol: __atomic_load_4
    #56 84.12 >>> referenced by gcc_libinit.c
    #56 84.12 >>>               /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
    #56 84.12 >>> referenced by gcc_libinit.c
    #56 84.12 >>>               /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
    #56 84.12 >>> referenced by gcc_libinit.c
    #56 84.12 >>>               /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
    #56 84.12 >>> referenced 2 more times
    #56 84.12
    #56 84.12 ld.lld: error: undefined symbol: __atomic_store_4
    #56 84.12 >>> referenced by gcc_libinit.c
    #56 84.12 >>>               /tmp/go-link-759578347/000009.o:(_cgo_wait_runtime_init_done)
    #56 84.12 >>> referenced by gcc_libinit.c
    #56 84.12 >>>               /tmp/go-link-759578347/000009.o:(x_cgo_notify_runtime_init_done)
    #56 84.12 >>> referenced by gcc_libinit.c
    #56 84.12 >>>               /tmp/go-link-759578347/000009.o:(x_cgo_set_context_function)
    #56 84.12 clang: error: linker command failed with exit code 1 (use -v to see invocation)

From discussion on GitHub;
https://github.com/moby/moby/pull/46982#issuecomment-2206992611

The arm/v5 build failure looks to be due to libatomic not being included
in the link. For reasons probably buried in mailing list archives,
[gcc](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358) and clang don't
bother to implicitly auto-link libatomic. This is not a big deal on many
modern platforms with atomic intrinsics as the compiler generates inline
instruction sequences, avoiding any libcalls into libatomic. ARMv5 is not
one of those platforms: all atomic operations require a libcall.

In theory, adding `CGO_LDFLAGS=-latomic` should fix arm/v5 builds.

While it could be argued that cgo should automatically link against
libatomic in the same way that it automatically links against libpthread,
the Go maintainers would have a valid counter-argument that it should be
the C toolchain's responsibility to link against libatomic automatically,
just like it does with libgcc or compiler-rt.

Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Cory Snider <csnider@mirantis.com>
2024-09-02 12:45:46 +02:00
Cory Snider
e853c093bf hack/make/.binary: set CCGO_CFLAGS=-Wno-atomic-alignment for arm/v5
cross-compiling for arm/v5 fails on go1.22; a fix is included for this
in go1.23 (https://github.com/golang/go/issues/65290), but for go1.22
we can set the correct option manually.

    1.189 + go build -mod=vendor -modfile=vendor.mod -o /tmp/bundles/binary-daemon/dockerd -tags 'netgo osusergo static_build journald' -ldflags '-w -X "github.com/docker/docker/dockerversion.Version=dev" -X "github.com/docker/docker/dockerversion.GitCommit=HEAD" -X "github.com/docker/docker/dockerversion.BuildTime=2024-08-29T16:59:57.000000000+00:00" -X "github.com/docker/docker/dockerversion.PlatformName=" -X "github.com/docker/docker/dockerversion.ProductName=" -X "github.com/docker/docker/dockerversion.DefaultProductLicense=" -extldflags -static ' -gcflags= github.com/docker/docker/cmd/dockerd
    67.78 # runtime/cgo
    67.78 gcc_libinit.c:44:8: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0 bytes) [-Werror,-Watomic-alignment]
    67.78 gcc_libinit.c:47:6: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0 bytes) [-Werror,-Watomic-alignment]
    67.78 gcc_libinit.c:49:10: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0 bytes) [-Werror,-Watomic-alignment]
    67.78 gcc_libinit.c:69:9: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0 bytes) [-Werror,-Watomic-alignment]
    67.78 gcc_libinit.c:71:3: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0 bytes) [-Werror,-Watomic-alignment]
    78.20 + rm -f /go/src/github.com/docker/docker/go.mod

Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Cory Snider <csnider@mirantis.com>
2024-09-02 12:45:44 +02:00
Sebastiaan van Stijn
5ea96cad4b Merge pull request #48119 from thaJeztah/deprecate_RequestPrivilegeFunc
api/types: move RequestPrivilegeFunc to api/types/registry
2024-08-30 15:41:03 +02:00
Sebastiaan van Stijn
bb899c654a api/types: move RequestPrivilegeFunc to api/types/registry
Move the definition, but mostly keep it for documentation purposes,
to prevent having to import the registry package in all places.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-30 14:13:09 +02:00
Tianon Gravi
04b0e61d8b Merge pull request #48388 from corhere/dockerd-manpage-install
man: create parent directories in install recipe
2024-08-29 14:34:00 -07:00
Cory Snider
88b118688e man: create parent directories in install recipe
Support the use of `make install` in packaging scripts, where the
$mandir tree might not exist under $DESTDIR.

For portability, create the parent directories using a separate install
command instead of relying on the non-portable `-D` flag.

Set errexit so the install target fails if any install step fails.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2024-08-29 15:39:03 -04:00
Sebastiaan van Stijn
980d8e5d54 Merge pull request #48403 from thaJeztah/test_registry_v3
Dockerfile: update registry to v3.0.0-beta.1
2024-08-29 20:52:43 +02:00
Paweł Gronowski
980275dc90 Merge pull request #48399 from vvoland/c8d-list-nonimage
c8d/list: Don't exclude non-container images
2024-08-29 19:16:23 +02:00
Sebastiaan van Stijn
3cf42971b9 Merge pull request #48398 from AkihiroSuda/golang-x-20240829
vendor.mod: golang.org/x/* latest
2024-08-29 18:05:18 +02:00
Sebastiaan van Stijn
9bbe5a50dd Dockerfile: update registry to v3.0.0-beta.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-29 17:02:55 +02:00
Paweł Gronowski
f4e82e2fb0 c8d/list: Don't exclude non-container images
Before this, the image list would not show images that are not a valid
container image, but could be a valid artifact.

While they're not directly usable by docker, we should still show them
so the user can still discover them and at least be able to delete them.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-29 11:56:17 +02:00
Sebastiaan van Stijn
623e717bc4 Merge pull request #48373 from thaJeztah/cleanup_portallocator
libnetwork/portallocator: assorted cleanups
2024-08-29 11:39:20 +02:00
Akihiro Suda
d6446d81d8 vendor.mod: golang.org/x/net v0.28.0, etc.
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-08-29 16:52:02 +09:00
Akihiro Suda
65fdd363a0 vendor.mod: golang.org/x/time v0.6.0
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-08-29 16:48:19 +09:00