Commit graph

45412 commits

Author SHA1 Message Date
CrazyMax
71fa3b1337
Dockerfile: fix PKG_CONFIG for xx
Current implementation in hack/make.sh overwrites PKG_CONFIG
if not defined and set it to pkg-config. When a build is invoked
using xx in our Dockerfile, it will set PKG_CONFIG to the right
value in go environments depending on the target architecture: 8015613ccc/base/xx-go (L75-L78)

Also needs to install dpkg-dev to use pkg-config when cross-building

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-16 11:42:13 +01:00
Kevin Alvarez
945704208a
hack: name for target ARM architecture not specified
Build currently doesn't set the right name for target ARM
architecture through switches in CGO_CFLAGS and CGO_CXXFLAGS
when doing cross-compilation. This was previously fixed in https://github.com/moby/moby/pull/43474

Also removes the toolchain configuration. Following changes for
cross-compilation in https://github.com/moby/moby/pull/44546,
we forgot to remove the toolchain configuration that is
not used anymore as xx already sets correct cc/cxx envs already.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-16 11:40:47 +01:00
CrazyMax
94639eb66f
hack: typo in displayed platform name
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-16 11:40:47 +01:00
Bjorn Neergaard
98c1140c44
Merge pull request #44824 from neersighted/revert_44706
Revert "libnetwork: Support IPv6 in arrangeUserFilterRule()"
2023-01-14 17:14:26 -07:00
Bjorn Neergaard
17723691e5
Revert "libnetwork: Support IPv6 in arrangeUserFilterRule()"
This reverts commit 2d397beb00.

moby#44706 and moby#44805 were both merged, and both refactored the same
file. The combination broke the build, and was not detected in CI as
only the combination of the two, applied to the same parent commit,
caused the failure.

moby#44706 should be carried forward, based on the current master, in
order to resolve this conflict.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-01-14 15:31:56 -07:00
Bjorn Neergaard
803c21f4b2
Merge pull request #44706 from akerouanton/fix-44451
libnetwork: Support IPv6 in arrangeUserFilterRule()
2023-01-14 15:18:01 -07:00
Bjorn Neergaard
eb20ed1f69
Merge pull request #44789 from jg-public/specspath-to-registry
plugins: Move SpecPaths into LocalRegistry
2023-01-14 15:09:12 -07:00
Bjorn Neergaard
d62a88eb0d
Merge pull request #44822 from thaJeztah/update_ipvs
vendor: github.com/moby/ipvs v1.1.0
2023-01-14 14:58:52 -07:00
Bjorn Neergaard
2cff71d71c
Merge pull request #44788 from jg-public/homedir-fallback
homedir: fallback to getpwent(3) if XDG_XX_HOME and HOME are unset
2023-01-14 14:57:06 -07:00
Jan Garcia
833096ce42 homedir: fallback to user.Current().homeDir if XDG_DATA_HOME/XDG_CONFIG_HOME and HOME are unset
Signed-off-by: Jan Garcia <github-public@n-garcia.com>
2023-01-14 17:38:34 +01:00
Sebastiaan van Stijn
af6b5d55db
vendor: github.com/moby/ipvs v1.1.0
full diff: https://github.com/moby/ipvs/compare/v1.0.2...v1.1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-14 17:25:22 +01:00
Sebastiaan van Stijn
f53feeea8b
vendor: github.com/vishvananda/netns v0.0.2
full diff: https://github.com/vishvananda/netns/compare/v0.0.1...v0.0.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-14 17:23:50 +01:00
Akihiro Suda
219ced474d
Merge pull request #44819 from thaJeztah/bump_netns
vendor: github.com/vishvananda/netns v0.0.1
2023-01-14 08:45:44 +09:00
Cory Snider
2504e4ad0d
Merge pull request #44805 from corhere/libnet/return-concrete-types
libnetwork: replace some unnecessary interfaces with their concrete types
2023-01-13 17:00:37 -05:00
Cory Snider
8be470eea8 libnetwork: don't embed mutex in network
Embedded structs are part of the exported surface of a struct type.
Boxing a struct value into an interface value does not erase that;
any code could gain access to the embedded struct value with a simple
type assertion. The mutex is supposed to be a private implementation
detail, but *network implements sync.Locker because the mutex is
embedded. Change the mutex to an unexported field so *network no
longer spuriously implements the sync.Locker interface.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-13 14:19:06 -05:00
Cory Snider
c71555f030 libnetwork: return concrete-typed *Endpoint
libnetwork.Endpoint is an interface with a single implementation.

https://github.com/golang/go/wiki/CodeReviewComments#interfaces

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-13 14:19:06 -05:00
Cory Snider
581f005aad libnetwork: don't embed mutex in endpoint
Embedded structs are part of the exported surface of a struct type.
Boxing a struct value into an interface value does not erase that;
any code could gain access to the embedded struct value with a simple
type assertion. The mutex is supposed to be a private implementation
detail, but *endpoint implements sync.Locker because the mutex is
embedded. Change the mutex to an unexported field so *endpoint no
longer spuriously implements the sync.Locker interface.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-13 14:19:06 -05:00
Cory Snider
0e91d2e0e9 libnetwork: return concrete-typed *Sandbox
Basically every exported method which takes a libnetwork.Sandbox
argument asserts that the value's concrete type is *sandbox. Passing any
other implementation of the interface is a runtime error! This interface
is a footgun, and clearly not necessary. Export and use the concrete
type instead.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-13 14:19:06 -05:00
Cory Snider
0425baf883 libnetwork: don't embed mutex in sandbox
Embedded structs are part of the exported surface of a struct type.
Boxing a struct value into an interface value does not erase that;
any code could gain access to the embedded struct value with a simple
type assertion. The mutex is supposed to be a private implementation
detail, but *sandbox implements sync.Locker because the mutex is
embedded. Change the mutex to an unexported field so *sandbox no
longer spuriously implements the sync.Locker interface.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-13 14:09:37 -05:00
Cory Snider
f96b9bf761 libnetwork: return concrete-typed *Controller
libnetwork.NetworkController is an interface with a single
implementation.

https://github.com/golang/go/wiki/CodeReviewComments#interfaces

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-13 14:09:37 -05:00
Cory Snider
ae09fe3da7 libnetwork: don't embed mutex in controller
Embedded structs are part of the exported surface of a struct type.
Boxing a struct value into an interface value does not erase that;
any code could gain access to the embedded struct value with a simple
type assertion. The mutex is supposed to be a private implementation
detail, but *controller implements sync.Locker because the mutex is
embedded.

    c, _ := libnetwork.New()
    c.(sync.Locker).Lock()

Change the mutex to an unexported field so *controller no longer
spuriously implements the sync.Locker interface.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-13 14:09:37 -05:00
Brian Goff
483b03562a
Merge pull request #44491 from corhere/libnetwork-minus-reexec
libnetwork: eliminate almost all reexecs
2023-01-13 10:44:25 -08:00
Sebastiaan van Stijn
bb5cae2c94
vendor: github.com/vishvananda/netns v0.0.1
The project started tagging releases for go modules.

full diff: https://github.com/vishvananda/netns/compare/2eb08e3e575f...v0.0.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-13 14:55:18 +01:00
Bjorn Neergaard
868c897ad7
Merge pull request #44790 from neersighted/wide_json
daemon/config: support alternate (common) unicode encodings using a BOM
2023-01-12 13:15:58 -07:00
Bjorn Neergaard
4cd84c4b13
Merge pull request #44773 from neersighted/daemon_config_test
daemon/config: clean up tests to use common helper
2023-01-12 13:13:35 -07:00
Bjorn Neergaard
228f82fcda
Merge pull request #44628 from vvoland/c8d-import-upstream
daemon/c8d: Implement import
2023-01-12 09:35:43 -07:00
Bjorn Neergaard
5bb0e7080a
Merge pull request #44791 from corhere/default-sigquit-handler
cmd/dockerd: use default SIGQUIT behaviour
2023-01-12 08:37:05 -07:00
Bjorn Neergaard
dae48a8064
Merge pull request #44803 from akerouanton/fix-44721
libnetwork: Remove iptables nat rule when hairpin is disabled
2023-01-12 08:36:10 -07:00
Bjorn Neergaard
4c02882f8a
Merge pull request #43225 from aivus/docker-in-overlayfs
Work around missing rename support when the backing filesystem is overlayfs
2023-01-11 17:54:32 -07:00
Bjorn Neergaard
6d212fa045
Merge pull request #44756 from rumpl/containerd-image-pull
containerd integration: image pull
2023-01-11 16:22:48 -07:00
Cory Snider
102090916e libnetwork: addRedirectRules without reexec
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-11 12:14:32 -05:00
Cory Snider
582dd705c1 libnetwork: fwmarker without reexec
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-11 12:14:32 -05:00
Cory Snider
d6cc02d301 libnetwork: drop (resolver).resolverKey field
...as it is now unused.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-11 12:14:32 -05:00
Cory Snider
50a4951ddc libnetwork: setup DNS resolver without reexec
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-11 12:14:32 -05:00
Cory Snider
4733127a04 libnetwork: set default VLAN without reexec
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-11 12:14:31 -05:00
Cory Snider
7037c48e58 libnetwork: set IPv6 without reexec
unshare.Go() is not used as an existing network namespace needs to be
entered, not a new one created. Explicitly lock main() to the initial
thread so as not to depend on the side effects of importing the
internal/unshare package to achieve the same.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-11 12:05:39 -05:00
Cory Snider
0246332954 libnetwork: create netns without reexec
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-11 12:05:39 -05:00
Bjorn Neergaard
ffb2c1fb4a
Merge pull request #44802 from akerouanton/libnetwork-sysfs-cleanup
libnetwork: Clean up sysfs-based operations
2023-01-11 10:04:51 -07:00
Albin Kerouanton
ef161d4aeb
libnetwork: Clean up sysfs-based operations
- The oldest kernel version currently supported is v3.10. Bridge
parameters can be set through netlink since v3.8 (see
torvalds/linux@25c71c7). As such, we don't need to fallback to sysfs to
set hairpin mode.
- `scanInterfaceStats()` is never called, so no need to keep it alive.
- Document why `default_pvid` is set through sysfs

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-01-11 17:01:53 +01:00
Paweł Gronowski
9032e6779d c8d/resolver: Fallback to http for insecure registries
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-11 17:00:27 +01:00
Nicolas De Loof
c83fce86d4 c8d/resolver: Use hosts from daemon configuration
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-01-11 17:00:27 +01:00
Paweł Gronowski
3a3f98b32b c8d/pull: Don't unpack manually
We pass WithPullUnpack anyway

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-11 17:00:27 +01:00
Nicolas De Loof
4a8c4110e3 produce progress events polling ctrd's content.Store
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

containerd: Push progress

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-11 17:00:26 +01:00
Albin Kerouanton
566a2e4c79
libnetwork: Remove iptables nat rule when hairpin is disabled
When userland-proxy is turned off and on again, the iptables nat rule
doing hairpinning isn't properly removed. This fix makes sure this nat
rule is removed whenever the bridge is torn down or hairpinning is
disabled (through setting userland-proxy to true).

Unlike for ip masquerading and ICC, the `programChainRule()` call
setting up the "MASQ LOCAL HOST" rule has to be called unconditionally
because the hairpin parameter isn't restored from the driver store, but
always comes from the driver config.

For the "SKIP DNAT" rule, things are a bit different: this rule is
always deleted by `removeIPChains()` when the bridge driver is
initialized.

Fixes #44721.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-01-11 16:32:18 +01:00
Sebastiaan van Stijn
a0572a40ab
Merge pull request #44793 from thaJeztah/bump_go_1.19.5
update to go1.19.5
2023-01-11 16:26:00 +01:00
Sebastiaan van Stijn
d3dec8fae1
Merge pull request #44784 from thaJeztah/api_sync_docs
docs: api: synchronise versioned API docs (v1.39 - v1.42)
2023-01-11 13:55:42 +01:00
Paweł Gronowski
d7deec1993
daemon/c8d: Implement import
If the imported layer archive is uncompressed, it gets compressed with
gzip before writing to the content store.
Archives compressed with gzip and zstd are imported as-is.
Xz and bzip2 are recompressed into gzip.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-11 13:53:44 +01:00
Paweł Gronowski
a254dad2e5
api/import: Guard from Digested instead of Canonical reference
Import shouldn't accept any digested reference, instead of only strictly
canonical ones.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-11 13:53:42 +01:00
Paweł Gronowski
28327f10a2
daemon/import: Extract common logic to api
Extract logic that would need to be duplicated in both implementations
of ImageService.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-11 13:53:40 +01:00
Bjorn Neergaard
b139a7636f
Merge pull request #44792 from neersighted/rip_derek
CONTRIBUTING.md: drop reference to the Derek GitHub bot
2023-01-10 17:30:44 -07:00