Commit Graph

49900 Commits

Author SHA1 Message Date
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
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
Akihiro Suda
4bfdfd6f72 vendor.mod: golang.org/x/sys v0.24.0
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-08-29 16:46:40 +09:00
Akihiro Suda
78d0ef5e87 vendor.mod: golang.org/x/sync v0.8.0
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-08-29 16:46:08 +09:00
Akihiro Suda
492fe40052 vendor.mod: golang.org/x/mod v0.20.0
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-08-29 16:45:21 +09:00
Akihiro Suda
d7ff6b5085 vendor.mod: drop direct dependency on golang.org/x/exp
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-08-29 16:44:32 +09:00
Sebastiaan van Stijn
92a05cf414 Merge pull request #48359 from thaJeztah/fix_linting_issues
Fix linting issues in preparation of Go and GolangCI-lint update
2024-08-28 15:48:29 +02:00
Sebastiaan van Stijn
9fca5e7b6f Merge pull request #48368 from thaJeztah/vendor_netlink_1.2.1
vendor: github.com/vishvananda/netlink v1.3.0
2024-08-28 10:26:55 +02:00
Sebastiaan van Stijn
8e580efb73 portallocator: un-export PortAllocator.Begin, PortAllocator.End
These values are configured when instantiating the allocator, and not
intended to be mutated externally. They're only used internally with
the exception of a test in the bridge driver that uses it to pick a
port that can be used for testing.

This patch:

- un-exports the Begin and End fields
- introduces a GetPortRange() utility to allow the bridge driver
  to get the port, but marking it as a function for internal use.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 17:15:30 +02:00
Sebastiaan van Stijn
fb1ae4bdb7 portallocator: RequestPortsInRange: validate range once
RequestPortsInRange calls portMap.getPortRange() in a loop, but the given
port-range is always the same. Perform validation once instead of for each
iteration.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 17:15:24 +02:00
Sebastiaan van Stijn
05d784d6da portallocator: make newPortMap a regular constructor
It was a method on PortAllocator, but not really related, other than
reading the default values.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 17:07:26 +02:00
Sebastiaan van Stijn
c00f6281d9 portallocator: RequestPort: skip RequestPortInRange as intermediate
RequestPortInRange is a wrapper for RequestPortsInRange; skip it as
intermediate function.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 17:07:25 +02:00
Sebastiaan van Stijn
78d88d06dc portallocator: use net.IPv4zero for defaultIP, and make it a property
Use the variable that's provided by the net package, and make the defaultIP
a property of the allocator instead of a package variable.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 17:07:25 +02:00
Sebastiaan van Stijn
630a47177b portallocator: use new instance in tests
Test the functionality in isolation instead of using the singleton that's
returned by the `GET` function; this makes sure tests don't affect each other,
and doesn't require resetting the singleton in between tests, potentially
allowing these tests to eb run in parallel.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 17:07:25 +02:00
Sebastiaan van Stijn
1897a21d60 portallocator: ReleaseAll: remove unused error-return
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 17:07:25 +02:00
Sebastiaan van Stijn
2a2176f317 portallocator: RequestPortInRange: fix doc-link in godoc
The doc-link was not formatted correctly and didn't work. While updating
also slightly touch-up the description to explain "defaultIP".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 17:07:22 +02:00
Paweł Gronowski
dfb88e57d5 Merge pull request #48382 from vvoland/update-containerd-1.7.21
Dockerfile/vendor: update containerd to v1.7.21
2024-08-27 14:19:04 +02:00
Paweł Gronowski
a88efd7359 vendor: github.com/containerd/containerd v1.7.21
full diff: https://github.com/containerd/containerd/compare/v1.7.20...v1.7.21

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-27 13:32:35 +02:00
Paweł Gronowski
de4fc1c927 Dockerfile: update containerd binary to v1.7.21 (static binaries and CI only)
Update the containerd binary that's used in CI and static binaries

- full diff: https://github.com/containerd/containerd/compare/v1.7.20...v1.7.21
- release notes: https://github.com/containerd/containerd/releases/tag/v1.7.21

```markdown changelog
Update containerd (static binaries only) to [v1.7.21](https://github.com/containerd/containerd/releases/tag/v1.7.21)
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-27 13:28:34 +02:00
Sebastiaan van Stijn
1ad5b5abb2 daemon: fix non-constant format string in call (govet)
daemon/daemon.go:942:21: printf: non-constant format string in call to (*github.com/docker/docker/vendor/github.com/sirupsen/logrus.Entry).Errorf (govet)
            log.G(ctx).Errorf(err.Error())
                              ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 10:41:58 +02:00
Sebastiaan van Stijn
005b488506 api/types: fix non-constant format string in call (govet)
api/types/container/hostconfig.go:328:43: printf: non-constant format string in call to fmt.Errorf (govet)
                return &errInvalidParameter{fmt.Errorf(msg)}
                                                       ^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 10:41:58 +02:00
Sebastiaan van Stijn
0fd3a53c12 api/server/router: fix non-constant format string in call (govet)
api/server/router/container/container_routes.go:943:22: printf: non-constant format string in call to fmt.Fprintf (govet)
                fmt.Fprintf(conn, "HTTP/1.1 101 UPGRADED\r\nContent-Type: "+contentType+"\r\nConnection: Upgrade\r\nUpgrade: tcp\r\n\r\n")
                                  ^
    api/server/router/image/image_routes.go:144:50: printf: non-constant format string in call to github.com/docker/docker/pkg/streamformatter.FormatStatus (govet)
                output.Write(streamformatter.FormatStatus("", id.String()))
                                                              ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 10:41:46 +02:00
Sebastiaan van Stijn
4a93233b88 container/stream: fix non-constant format string in call (govet)
container/stream/streams.go:111:21: printf: non-constant format string in call to fmt.Errorf (govet)
            return fmt.Errorf(strings.Join(errors, "\n"))
                              ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 10:23:40 +02:00
Sebastiaan van Stijn
068c1bf3be libnetwork/drivers/bridge: fix non-constant format string in call (govet)
libnetwork/drivers/bridge/setup_ip_tables_linux.go:385:23: printf: non-constant format string in call to fmt.Errorf (govet)
                    return fmt.Errorf(msg)
                                      ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 10:23:40 +02:00
Sebastiaan van Stijn
f434cdd14a volume/testutils: fix non-constant format string in call (govet)
volume/testutils/testutils.go:98:26: printf: non-constant format string in call to fmt.Errorf (govet)
            return nil, fmt.Errorf(opts["error"])
                                   ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 10:23:40 +02:00