Commit graph

44843 commits

Author SHA1 Message Date
Sebastiaan van Stijn
8a5d341d94
[23.0] vendor: github.com/moby/buildkit v0.10.7-0.20230206124303-b8fdb4b78da0
full diff: https://github.com/moby/buildkit/compare/v0.10.6...b8fdb4b78da0127260ba39b9b7de048cb3877203

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-07 09:55:22 +01:00
Bjorn Neergaard
fc5d6c97b3
Merge pull request #44937 from corhere/backport-23.0/fix-44925-ipvlan-panic
[23.0 backport] libnet/d/ipvlan: gracefully migrate from older dbs
2023-02-06 22:56:35 -07:00
Cory Snider
427101f656 libnet/d/ipvlan: gracefully migrate from older dbs
IPVLAN networks created on Moby v20.10 do not have the IpvlanFlag
configuration value persisted in the libnetwork database as that config
value did not exist before v23.0.0. Gracefully migrate configurations on
unmarshal to prevent type-assertion panics at daemon start after upgrade.

Fixes #44925

Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit 91725ddc92)
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-06 18:16:21 -05:00
Sebastiaan van Stijn
b67344b81c
Merge pull request #44938 from thaJeztah/23.0_backport_dockerfile_git_dubious
[23.0 backport] Dockerfile: configure code dir as "safe" directory
2023-02-07 00:14:30 +01:00
Sebastiaan van Stijn
5b7142073f
Dockerfile: configure code dir as "safe" directory
CI is failing when bind-mounting source from the host into the dev-container;

    fatal: detected dubious ownership in repository at '/go/src/github.com/docker/docker'
    To add an exception for this directory, call:

        git config --global --add safe.directory /go/src/github.com/docker/docker

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 21677816a0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-06 21:08:42 +01:00
Bjorn Neergaard
bacf32d9ab
Merge pull request #44892 from corhere/backport-23.0/fix-kata-exec-exit
[23.0 backport] Fix exit-event handling for Kata runtime
2023-02-06 12:02:50 -07:00
Brian Goff
7df264966b
Merge pull request #44922 from neersighted/backport/44916/23.0
[23.0 backport] graphdriver/overlay2: usingMetacopy ENOTSUP is non-fatal
2023-02-04 06:54:29 -08:00
Bjorn Neergaard
7e03250780
graphdriver/overlay2: usingMetacopy ENOTSUP is non-fatal
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit 3bcb350711)
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-02-04 00:07:08 -07:00
Cory Snider
975bdb2c96 daemon: identify container exits by ProcessID
The Pid field of an exit event cannot be relied upon to differentiate
exits of the container's task from exits of other container processes,
i.e. execs. The Pid is reported by the runtime and is implementation-
defined so there is no guarantee that a task's pid is distinct from the
pids of any other process in the same container. In particular,
kata-containers reports the pid of the hypervisor for all exit events.
Update the daemon to differentiate container exits from exec exits by
inspecting the event's ProcessID.

The local_windows libcontainerd implementation already sets the
ProcessID to InitProcessName on container exit events. Update the remote
libcontainerd implementation to match. ContainerD guarantees that the
process ID of a task (container init process) is set to the
corresponding container ID, so use that invariant to distinguish task
exits from other process exits.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-31 12:14:50 -05:00
Sebastiaan van Stijn
d7573ab867
Merge pull request #44885 from thaJeztah/23.0_backport_update_containerd
[23.0 backport] vendor: github.com/containerd/containerd v1.6.16
2023-01-31 15:29:44 +01:00
Sebastiaan van Stijn
9df87eaa9c
Merge pull request #44883 from thaJeztah/23.0_backport_invalid_character
[23.0 backport] client: improve error messaging on crash
2023-01-31 15:28:37 +01:00
Sebastiaan van Stijn
de3f216113
Merge pull request #44884 from thaJeztah/23.0_backport_rm_install_suffix
[23.0 backport] hack: remove -installsuffix build flag
2023-01-31 13:56:33 +01:00
Akihiro Suda
20203f0c92
Merge pull request #44881 from thaJeztah/23.0_containerd_binary_1.6.16
[23.0] update containerd binary to v1.6.16
2023-01-31 02:00:12 +09:00
Sebastiaan van Stijn
610250f06e
vendor: github.com/containerd/containerd v1.6.16
Notable Updates

- Fix push error propagation
- Fix slice append error with HugepageLimits for Linux
- Update default seccomp profile for PKU and CAP_SYS_NICE
- Fix overlayfs error when upperdirlabel option is set

full diff: https://github.com/containerd/containerd/compare/v1.6.15...v1.6.16

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c41c8c2f86)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-30 15:08:36 +01:00
Sebastiaan van Stijn
63a0f1fe09
vendor: github.com/pelletier/go-toml v1.9.5
Contains a fix that prevents a panic on an invalid toml file.

full diff: https://github.com/pelletier/go-toml/compare/v1.9.4...v1.9.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 22098745e7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-30 15:08:36 +01:00
CrazyMax
699e853be3
hack: display build cmd when DOCKER_DEBUG set
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 170a1c4709)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-30 15:06:33 +01:00
CrazyMax
b7e0725e98
hack: remove unnecessary vars in make.sh script
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 877baae03e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-30 15:06:32 +01:00
CrazyMax
96746238b2
hack: remove ORIG_BUILDFLAGS var
This var was used for the cross target but it has been removed
in 8086f40123 so not necessary anymore

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit b80f16157e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-30 15:06:32 +01:00
CrazyMax
df2fe70049
hack: remove -installsuffix build flag
Has been introduced in 232d59baeb to work around a bug with
"go build" but not required anymore since go 1.5: 4dab6d01f1

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 0c008cc4f8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-30 15:06:32 +01:00
Nick Santos
8b83e09b9c
client: improve error messaging on crash
Repro steps:
- Run Docker Desktop
- Run `docker run busybox tail -f /dev/null`
- Run `pkill "Docker Desktop"

Expected:
An error message that indicates that Docker Desktop is shutting down.

Actual:
An error message that looks like this:

```
error waiting for container: invalid character 's' looking for beginning of value
```

here's an example:

https://github.com/docker/for-mac/issues/6575#issuecomment-1324879001

After this change, you get an error message like:

```
error waiting for container: copying response body from Docker: unexpected EOF
```

which is a bit more explicit.

Signed-off-by: Nick Santos <nick.santos@docker.com>
(cherry picked from commit 9900c7a348)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-30 15:03:01 +01:00
Sebastiaan van Stijn
26e9face5a
[23.0] update containerd binary to v1.6.16
Notable Updates

- Fix push error propagation
- Fix slice append error with HugepageLimits for Linux
- Update default seccomp profile for PKU and CAP_SYS_NICE
- Fix overlayfs error when upperdirlabel option is set

full diff: https://github.com/containerd/containerd/compare/v1.6.15...v1.6.16

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-30 09:16:22 +01:00
Sebastiaan van Stijn
9f62b37a62
Merge pull request #44863 from thaJeztah/23.0_backport_rootless_ipc_host
[23.0 backport] rootless: support `--ipc=host`
2023-01-20 18:49:22 +01:00
Sebastiaan van Stijn
3f87416881
Merge pull request #44862 from thaJeztah/23.0_backport_fix_arm
[23.0 backport] hack: check if cross-compiling before setting ARM target name
2023-01-20 17:59:14 +01:00
Akihiro Suda
6641852d51
rootless: support --ipc=host
Fix issue 44294

Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit b3c5352386)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-20 17:02:23 +01:00
CrazyMax
8fc49af4ab
hack: check if cross-compiling before setting ARM target name
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 67aa86f1e0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-20 16:40:33 +01:00
Bjorn Neergaard
b968cb92e6
Merge pull request #44858 from thaJeztah/23.0_backport_bump_swarmkit
[23.0 backport] vendor: github.com/moby/swarmkit/v2 v2.0.0-20230119195359-904c221ac281
2023-01-19 18:11:15 -07:00
Sebastiaan van Stijn
62c7b25605
Merge pull request #44856 from corhere/backport-23.0/fix-bytespipe-deadlock
[23.0 backport] Fix bytespipe blockThreshold deadlock bug
2023-01-20 00:33:44 +01:00
Sebastiaan van Stijn
30134ab177
vendor: github.com/moby/swarmkit/v2 v2.0.0-20230119195359-904c221ac281
full diff: 0da442b278...904c221ac2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 25f95b0000)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-19 23:39:26 +01:00
ningmingxiao
3da45c0fe7 fix blockThreshold full bug
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
(cherry picked from commit dcfe23a038)
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-19 16:37:40 -05:00
Cory Snider
941a07b339 ioutils: add regression test for bytespipe deadlock
Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit 0b83fd3217)
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-19 16:37:40 -05:00
Cory Snider
cd5e05ee14
Merge pull request #44845 from thaJeztah/23.0_backport_reimplement_44706
[23.0 backport] libnetwork: Support IPv6 in arrangeUserFilterRule()
2023-01-19 16:22:15 -05:00
Bjorn Neergaard
f825537119
Merge pull request #44855 from thaJeztah/23.0_backport_fix_arm64_build
[23.0 backport] Dockerfile: prefer ld for building against arm64
2023-01-19 13:23:07 -07:00
CrazyMax
a21381a55a
Dockerfile: prefer ld for building against arm64
We already prefer ld for cross-building arm64 but that seems
not enough as native arm64 build also has a linker issue with lld
so we need to also prefer ld for native arm64 build.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit d2d6ef431f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-19 16:39:11 +01:00
Albin Kerouanton
2616ebc5ac
libnetwork: Support IPv6 in arrangeUserFilterRule()
Fixes #44451.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit 2d397beb00)
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-19 08:19:09 -07:00
Bjorn Neergaard
cd0d7c49a6
Merge pull request #44728 from thaJeztah/23.0_backport_libnetwork_cleanup
[23.0 backport] libnetwork: cleanup config package, remove old integration tests
2023-01-19 07:40:07 -07:00
Sebastiaan van Stijn
7a5f3f8053
libnetwork: fix empty-lines (revive)
libnetwork/etchosts/etchosts_test.go:167:54: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/osl/route_linux.go:185:74: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/osl/sandbox_linux_test.go:323:36: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/bitseq/sequence.go:412:48: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/datastore/datastore_test.go:67:46: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/datastore/mock_store.go:34:60: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/iptables/firewalld.go:202:44: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/iptables/firewalld_test.go:76:36: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/iptables/iptables.go:256:67: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/iptables/iptables.go:303:128: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/networkdb/cluster.go:183:72: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/ipams/null/null_test.go:44:38: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/drivers/macvlan/macvlan_store.go:45:52: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/ipam/allocator_test.go:1058:39: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/drivers/bridge/port_mapping.go:88:111: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/drivers/bridge/link.go:26:90: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/drivers/bridge/setup_ipv6_test.go:17:34: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/drivers/bridge/setup_ip_tables.go:392:4: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/drivers/bridge/bridge.go:804:50: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/drivers/overlay/ov_serf.go:183:29: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/drivers/overlay/ov_utils.go:81:64: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/drivers/overlay/peerdb.go:172:67: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/drivers/overlay/peerdb.go:209:67: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/drivers/overlay/peerdb.go:344:89: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/drivers/overlay/peerdb.go:436:63: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/drivers/overlay/overlay.go:183:36: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/drivers/overlay/encryption.go:69:28: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/drivers/overlay/ov_network.go:563:81: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/default_gateway.go:32:43: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/errors_test.go:9:40: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/service_common.go:184:64: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/endpoint.go:161:55: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/store.go:320:33: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/store_linux_test.go:11:38: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/sandbox.go:571:36: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/service_common.go:317:246: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/endpoint.go:550:17: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/sandbox_dns_unix.go:213:106: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/controller.go:676:85: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/agent.go:876:60: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/resolver.go:324:69: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/network.go:1153:92: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/network.go:1955:67: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/network.go:2235:9: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/libnetwork_internal_test.go:336:26: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/resolver_test.go:76:35: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/libnetwork_test.go:303:38: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/libnetwork_test.go:985:46: empty-lines: extra empty line at the end of a block (revive)
    libnetwork/ipam/allocator_test.go:1263:37: empty-lines: extra empty line at the start of a block (revive)
    libnetwork/errors_test.go:9:40: empty-lines: extra empty line at the end of a block (revive)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit cd381aea56)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 21:24:32 +01:00
Sebastiaan van Stijn
7cfd4b3471
libnetwork/config: rename ParseConfigOptions() to New()
This function effectively is a constructor, so rename it to better describe
it's functionality.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 267108e113)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 21:24:32 +01:00
Sebastiaan van Stijn
1090c5fd4c
libnetwork/config: inline LoadDefaultScopes()
This method was an exported method, but only used as part of ParseConfigOptions,
so inlining it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 09cc2f9d0e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 21:24:32 +01:00
Sebastiaan van Stijn
c93e1e9e66
libnetwork/config: merge DaemonCfg into Config
It was unclear what the distinction was between these configuration
structs, so merging them to simplify.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 528428919e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 21:24:31 +01:00
Sebastiaan van Stijn
031fb72313
libnetwork: remove old integration tests
This was used for testing purposes when libnetwork was in a separate repo, using
the dnet utility, which was removed in 7266a956a8.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 571baffd59)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 21:24:31 +01:00
Sebastiaan van Stijn
a96a97bf47
libnetwork/config: remove ParseConfig()
Libnetwork configuration files were only used as part of integration tests using
the dnet utility, which was removed in 7266a956a8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 46f4a45769)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 21:24:31 +01:00
Sebastiaan van Stijn
9b383dbd51
libnetwork/config: inline ProcessOptions
This method was only used in a single place; inlining it makes it
easier to see what's done.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7d574f5ac6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 21:24:31 +01:00
Sebastiaan van Stijn
bed115e664
libnetwork/config: remove "Experimental" and "Debug" options
These were no longer used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a8a8bd1e42)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 21:24:28 +01:00
Sebastiaan van Stijn
9ea2300535
Merge pull request #44850 from crazy-max/23.0_backport_fix-static
[23.0 backport] Dockerfile: use clang to build dockerd/docker-proxy
2023-01-18 21:22:08 +01:00
Bjorn Neergaard
5ae2d06a1f
Merge pull request #44843 from thaJeztah/23.0_backport_bump_x_net
[23.0 backport] vendor: golang.org/x packages
2023-01-18 12:21:27 -07:00
Bjorn Neergaard
9fd854976f
Merge pull request #44844 from thaJeztah/23.0_backport_homedir_nolinux_compat
[23.0 backport] Add GetLibHome stub for non-linux OS
2023-01-18 12:14:04 -07:00
CrazyMax
64cbbaa883
Dockerfile: smoke tests for static builds
Adds smoke test stage in our Dockerfile and a
GitHub Action workflow

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 518be73a5c)
2023-01-18 19:36:07 +01:00
Kevin Alvarez
4100226e27
Dockerfile: use clang to build dockerd/docker-proxy
Static binaries for dockerd are broken on armhf and armel (32-bit).
It seems to be an issue with GCC as building using clang solves
this issue. Also adds extra instruction to prefer ld for
cross-compiling arm64 in bullseye otherwise it doesn't link.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit f676dab8dc)
2023-01-18 19:36:07 +01:00
Sebastiaan van Stijn
72f5fabd97
Merge pull request #44848 from thaJeztah/23.0_backport_skip_lookup_on_windows
[23.0 backport] Disable chrootarchive.init() on Windows
2023-01-18 19:07:23 +01:00
Gabriel Adrian Samfira
dadeec4205
Disable chrootarchive.init() on Windows
Disables user.Lookup() and net.LookupHost() in the init() function on Windows.

Any package that simply imports pkg/chrootarchive will panic on Windows
Nano Server, due to missing netapi32.dll. While docker itself is not
meant to run on Nano Server, binaries that may import this package and
run on Nano server, will fail even if they don't really use any of the
functionality in this package while running on Nano.

Conflicts:
    pkg/chrootarchive/archive_unix.go

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
(cherry picked from commit f49c88f1c4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 17:06:11 +01:00