Commit graph

44898 commits

Author SHA1 Message Date
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
Roy Reznik
f328486cb3
Add GetLibHome stub for non-linux OS
Signed-off-by: Roy Reznik <roy@wiz.io>
(cherry picked from commit ff14f8ef16)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 13:04:57 +01:00
Sebastiaan van Stijn
8e83d28f31
vendor: golang.org/x/net v0.5.0
contains a fix for CVE-2022-41721, although it probably does not affect us.

full diff: https://github.com/golang/net/compare/v0.4.0...v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 65c6ba1fc4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 12:59:57 +01:00
Sebastiaan van Stijn
06eb6ab794
vendor: golang.org/x/text v0.6.0
full diff: https://github.com/golang/text/compare/v0.5.0...v0.6.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 824dc51341)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 12:59:49 +01:00
Sebastiaan van Stijn
31cf0bf181
vendor: golang.org/x/sys v0.4.0
full diff: https://github.com/golang/sys/compare/v0.3.0...v0.4.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e66e6bb28a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-18 12:59:38 +01:00
Sebastiaan van Stijn
4df8f779b5
Merge pull request #44834 from thaJeztah/23.0_backport_docker_in_overlayfs
[23.0 backport] Work around missing rename support when the backing filesystem is overlayfs
2023-01-18 10:42:34 +01:00
Sebastiaan van Stijn
52df0048f6
Merge pull request #44829 from thaJeztah/23.0_backport_update_ipvs
[23.0 backport] vendor: github.com/moby/ipvs v1.1.0
2023-01-18 10:24:37 +01:00
Bjorn Neergaard
110a9eaac1
Merge pull request #44832 from thaJeztah/23.0_backport_wide_json
[23.0 backport] daemon/config: support alternate (common) unicode encodings using a BOM
2023-01-17 22:00:54 -07:00
Sebastiaan van Stijn
d2998a4659
Merge pull request #44839 from crazy-max/23.0_backport_fix-arm-build
[23.0 backport] hack: name for target ARM architecture not specified
2023-01-17 22:40:02 +01:00
CrazyMax
0e4548bbe1
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>
(cherry picked from commit 71fa3b1337)
2023-01-17 20:17:18 +01:00
Kevin Alvarez
8c12a6648b
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>
(cherry picked from commit 945704208a)
2023-01-17 20:17:18 +01:00
CrazyMax
10c4ada049
hack: typo in displayed platform name
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 94639eb66f)
2023-01-17 20:17:08 +01:00
Bjorn Neergaard
10b536dd0f
Merge pull request #44831 from thaJeztah/23.0_backport_default_sigquit_handler
[23.0 backport] cmd/dockerd: use default SIGQUIT behaviour
2023-01-17 11:33:25 -07:00
Illia Antypenko
322149038a
Add additional loggig in case of error of renaming runtimes-old and removing it
Signed-off-by: Illia Antypenko <ilya@antipenko.pp.ua>
(cherry picked from commit 07ba3e35d3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-17 13:52:52 +01:00
Illia Antypenko
a8926de2a1
Handle docker start inside overlayfs
Raspberry Pi allows to start system under overlayfs.
Docker is successfully fallbacks to fuse-overlay but not starting
because of the `Error starting daemon: rename /var/lib/docker/runtimes /var/lib/docker/runtimes-old: invalid cross-device link` error
It's happening because `rename` is not supported by overlayfs.

After manually removing directory `runtimes` docker starts and works successfully

Signed-off-by: Illia Antypenko <ilya@antipenko.pp.ua>
(cherry picked from commit d591710f82)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-17 13:52:52 +01:00
Bjorn Neergaard
524de97334
daemon/config: inform the user when the input JSON contains invalid UTF-8
This helps ensure that users are not surprised by unexpected tokens in
the JSON parser, or fallout later in the daemon.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit 8dbc5df952)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-17 13:45:47 +01:00
Bjorn Neergaard
0b2eecdc8a
daemon/config: support alternate (common) unicode encodings using a BOM
This is a pragmatic but impure choice, in order to better support the
default tools available on Windows Server, and reduce user confusion due
to otherwise inscrutable-to-the-uninitiated errors like the following:

> invalid character 'þ' looking for beginning of value
> invalid character 'ÿ' looking for beginning of value

While meaningful to those who are familiar with and are equipped to
diagnose encoding issues, these characters will be hidden when the file
is edited with a BOM-aware text editor, and further confuse the user.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit d42495033e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-17 13:45:47 +01:00
Bjorn Neergaard
abff66b283
daemon/config: clean up tests to use common helper
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit 1dcf7d5b03)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-17 13:45:47 +01:00
Cory Snider
d9bdb61992
cmd/dockerd: use default SIGQUIT behaviour
dockerd handles SIGQUIT by dumping all goroutine stacks to standard
error and exiting. In contrast, the Go runtime's default SIGQUIT
behaviour... dumps all goroutine stacks to standard error and exits.
The default SIGQUIT behaviour is implemented directly in the runtime's
signal handler, and so is both more robust to bugs in the Go runtime and
does not perturb the state of the process to anywhere near same degree
as dumping goroutine stacks from a user goroutine. The only notable
difference from a user's perspective is that the process exits with
status 2 instead of 128+SIGQUIT.

Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit 0867d3173c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-17 13:41:01 +01:00
Sebastiaan van Stijn
c627132dc8
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>
(cherry picked from commit af6b5d55db)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-17 10:56:50 +01:00
Sebastiaan van Stijn
13a31b67de
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>
(cherry picked from commit f53feeea8b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-17 10:56:40 +01:00
Bjorn Neergaard
ebedb1c496
Merge pull request #44821 from thaJeztah/23.0_backport_bump_netns
[23.0 backport] vendor: github.com/vishvananda/netns v0.0.1
2023-01-14 14:58:21 -07:00
Sebastiaan van Stijn
bd5d9f3190
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>
(cherry picked from commit bb5cae2c94)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-14 14:59:18 +01:00
Bjorn Neergaard
7e4f58d894
Merge pull request #44811 from akerouanton/23.0-backport-44803
[23.0 backport] libnetwork: Remove iptables nat rule when hairpin is disabled
2023-01-12 10:42:01 -07:00
Albin Kerouanton
c8262e912f
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>
(cherry picked from commit 566a2e4)
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2023-01-12 17:28:49 +01:00
Sebastiaan van Stijn
225551ddef
Merge pull request #44785 from thaJeztah/23.0_backport_api_sync_docs
[23.0 backport] docs: api fixes and updates
2023-01-11 17:38:01 +01:00
Sebastiaan van Stijn
fb75789691
Merge pull request #44794 from thaJeztah/23.0_backport_bump_go_1.19.5
[23.0 backport] update to go1.19.5
2023-01-11 16:26:26 +01:00
Sebastiaan van Stijn
12e3398f64
update to go1.19.5
go1.19.5 (released 2023-01-10) includes fixes to the compiler, the linker,
and the crypto/x509, net/http, sync/atomic, and syscall packages. See the
Go 1.19.5 milestone on the issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.19.5+label%3ACherryPickApproved

full diff: https://github.com/golang/go/compare/go1.19.4...go1.19.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 155e8d7d78)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-11 00:18:27 +01:00
Sebastiaan van Stijn
076d57104a
docs: api: synchronise versioned API docs (v1.39 - v1.41)
synchronises some fixes between these API versions for the documentation,
including fixes from:

- 52a9f1689a
- 345346d7c6
- 18f85467e7
- 1557892c37

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 805aea501a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 16:46:25 +01:00
Sebastiaan van Stijn
8ce4ae1345
docs: api: synchronise versioned API docs (v1.42)
synchronises some fixes between these API versions for the documentation,
including fixes from:

- 18f85467e7
- 345346d7c6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 92cbd1c69e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 16:46:25 +01:00
Niel Drummond
f0fe353ca6
api: swagger: add errorDetail to CreateImageInfo
Signed-off-by: Niel Drummond <niel@drummond.lu>
(cherry picked from commit 1557892c37)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 16:46:09 +01:00
Niel Drummond
04371160f8
api: docs: add errorDetail to CreateImageInfo (v1.42)
Signed-off-by: Niel Drummond <niel@drummond.lu>
(cherry picked from commit d983fa0ebe)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 16:46:09 +01:00
Hsing-Yu (David) Chen
e753cce70f
docs: add 401 to possible status codes of /auth
Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
(cherry picked from commit 18f85467e7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 16:45:52 +01:00
Bjorn Neergaard
9fd3a437a6
Merge pull request #44775 from thaJeztah/23.0_backport_44610_logs_for_DNS_failures
[23.0 backport] libnetwork: improve logs for DNS failures
2023-01-10 08:14:11 -07:00
Bjorn Neergaard
fc690c56b5
Merge pull request #44776 from thaJeztah/23.0_backport_btrfs_uapi
[23.0 backport] graphdriver/btrfs: depend on kernel UAPI instead of libbtrfs
2023-01-10 08:13:12 -07:00
Bjorn Neergaard
aefb643d79
Merge pull request #44778 from thaJeztah/23.0_backport_fix_rootless_specspaths_T43111
[23.0 backport] Use user data path for plugin discovery in rootless mode
2023-01-10 08:12:41 -07:00
Bjorn Neergaard
d29ab757fb
Merge pull request #44777 from thaJeztah/23.0_backport_ignore_bom
[23.0 backport] daemon/config: ignore UTF-8 BOM in config JSON
2023-01-10 08:09:16 -07:00
Sebastiaan van Stijn
583018846c
Merge pull request #44779 from thaJeztah/23.0_backport_update_buildkit_ref
[23.0 backport] ci: update buildkit to fix integration tests
2023-01-10 12:45:59 +01:00
CrazyMax
4d7792417e
ci: update buildkit to fix integration tests
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit dc30785947)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 11:32:18 +01:00
Jan Garcia
5802ca9e08
rootless: move ./rootless to ./pkg/rootless
Signed-off-by: Jan Garcia <github-public@n-garcia.com>
(cherry picked from commit 6ab12ec8f4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 11:26:15 +01:00
Jan Garcia
33572e98c1
Use user paths for plugin discovery in rootless mode
Signed-off-by: Jan Garcia <github-public@n-garcia.com>
(cherry picked from commit c1bd5e9144)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 11:26:12 +01:00
Sebastiaan van Stijn
52c7a5d96b
daemon/config: New(): initialize config with platform-specific defaults
This centralizes more defaults, to be part of the config struct that's
created, instead of interweaving the defaults with other code in various
places.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b28e66cf4f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 11:03:04 +01:00
Bjorn Neergaard
101bd10d0e
daemon/config: group JSON preprocessing steps
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit cba3edbc37)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 10:51:06 +01:00
Bjorn Neergaard
def679d0e0
daemon/config: ignore UTF-8 BOM in config JSON
[RFC 8259] allows for JSON implementations to optionally ignore a BOM
when it helps with interoperability; do so in Moby as Notepad (the only
text editor available out of the box in many versions of Windows Server)
insists on writing UTF-8 with a BOM.

  [RFC 8259]: https://tools.ietf.org/html/rfc8259#section-8.1

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit bb19265ba8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 10:51:06 +01:00
Akihiro Suda
cf8c728f3c
graphdriver/btrfs: needs kernel headers >= 4.12, not >= 4.7
`linux/btrfs_tree.h` was not installed to `/usr/include` until kernel 4.12
fcc8487d47

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 89fb8b32f6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 10:46:26 +01:00
Bjorn Neergaard
e40c2410ca
Dockerfile.*: drop libbtrfs
This is no longer necessary after the switch to the kernel UAPI.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit aa80c33360)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-10 10:46:05 +01:00