Commit graph

44855 commits

Author SHA1 Message Date
Bjorn Neergaard
bc3805a0a0
Merge pull request #44959 from tonistiigi/23.0-buildkit-update-0208
[23.0] vendor: update buildkit to latest v0.10
2023-02-09 12:11:28 -07:00
Tonis Tiigi
4002fa877b
vendor: update buildkit to latest v0.10
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-02-08 07:57:57 -08:00
Bjorn Neergaard
77f3d31ed6
Merge pull request #44944 from thaJeztah/23.0_backport_worker_getremotes
[23.0 backport] builder: define GetRemotes for the worker
2023-02-08 08:44:21 -07:00
Tonis Tiigi
e697c9365f
builder: define GetRemotes for the worker
The function signature has changed since v0.10.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 335907d187)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-08 01:01:18 +01:00
Sebastiaan van Stijn
1141704bc9
Merge pull request #44952 from thaJeztah/23.0_backport_ci_fix_workflows
[23.0 backport] ci: fix branch filter pattern in buildkit workflow
2023-02-08 00:59:40 +01:00
CrazyMax
4c544c3d5f
ci: fix branch filter pattern in buildkit workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 80f8432b52)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-07 23:45:04 +01:00
Bjorn Neergaard
f7e2cbaf1b
Merge pull request #44948 from crazy-max/23.0_backport_ci-itg-cli-split
[23.0 backport] ci: enhance tests distribution
2023-02-07 12:43:42 -07:00
CrazyMax
06aca27cc1
ci: enhance tests distribution
Adds overrides with specific tests suites in our tests
matrix so we can reduce build time significantly.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 22776f8fdb)
2023-02-07 16:50:50 +01:00
Kevin Alvarez
001b2e778a
ci: update gotestlist to 0.3.1
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit e304e82b66)
2023-02-07 16:50:49 +01:00
Sebastiaan van Stijn
e664cc2239
Merge pull request #44942 from vvoland/apparmor-check-binary-23
[23.0 backport] apparmor: Check if apparmor_parser is available
2023-02-07 13:13:18 +01:00
Sebastiaan van Stijn
a25ab9224a
Merge pull request #44936 from thaJeztah/23.0_update_buildkit
[23.0] vendor: github.com/moby/buildkit v0.10.7-0.20230206124303-b8fdb4b78da0
2023-02-07 11:29:35 +01:00
Paweł Gronowski
38b70ebc3b
apparmor: Check if apparmor_parser is available
`hostSupports` doesn't check if the apparmor_parser is available.
It's possible in some environments that the apparmor will be enabled but
the tool to load the profile is not available which will cause the
ensureDefaultAppArmorProfile to fail completely.

This patch checks if the apparmor_parser is available. Otherwise the
function returns early, but still logs a warning to the daemon log.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit ab3fa46502)
2023-02-07 11:23:06 +01:00
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