Commit graph

43610 commits

Author SHA1 Message Date
Sebastiaan van Stijn
25c896fcc2
api: remove unused RootFS.BaseLayer
This field was used when Windows did not yet support regular images, and required
the base-image to pre-exist on the Windows machine (as those layers were not yet
allowed to be distributed).

Commit f342b27145 (docker 1.13.0, API v1.25) removed
usage of the field.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-05 17:59:39 +01:00
Sebastiaan van Stijn
3c6c9fa180
Merge pull request #43300 from thaJeztah/api_update_imageinspect_docs
API: improve swagger and go-doc for ImageInspect structs
2022-03-05 17:54:37 +01:00
Brian Goff
df664877e3
Merge pull request #43323 from thaJeztah/unalias
remove unneeded "digest" alias for "go-digest"
2022-03-04 16:28:05 -08:00
Sebastiaan van Stijn
7025029b98
Merge pull request #43306 from corhere/logfile-data-race
daemon/logger: fix data race in LogFile
2022-03-05 00:05:58 +01:00
Sebastiaan van Stijn
fe10283449
Merge pull request #43327 from thaJeztah/update_containerd_binary_1.5.10
update containerd binary to v1.5.10
2022-03-04 21:16:24 +01:00
Sebastiaan van Stijn
9ed8cd128a
Dockerfile.windows; update containerd binary to v1.5.10
Welcome to the v1.5.10 release of containerd!

The tenth patch release for containerd 1.5 includes a fix for [CVE-2022-23648][1]
and other issues.

Notable Updates

- Use fs.RootPath when mounting volumes (GHSA-crp2-qrr5-8pq7)
- Return init pid when clean dead shim in runc.v1/v2 shims
- Handle sigint/sigterm in shimv2
- Use readonly mount to read user/group info

[1]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23648
[2]: https://github.com/containerd/containerd/security/advisories/GHSA-crp2-qrr5-8pq7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-04 19:34:46 +01:00
Sebastiaan van Stijn
2c8f0a0c99
update containerd binary to v1.5.10
Welcome to the v1.5.10 release of containerd!

The tenth patch release for containerd 1.5 includes a fix for [CVE-2022-23648][1]
and other issues.

Notable Updates

- Use fs.RootPath when mounting volumes (GHSA-crp2-qrr5-8pq7)
- Return init pid when clean dead shim in runc.v1/v2 shims
- Handle sigint/sigterm in shimv2
- Use readonly mount to read user/group info

[1]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23648
[2]: https://github.com/containerd/containerd/security/advisories/GHSA-crp2-qrr5-8pq7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-04 19:34:03 +01:00
Sebastiaan van Stijn
61265cf963
Merge pull request #43325 from thaJeztah/bump_go_1.17.8
update to go 1.17.8 to address CVE-2022-24921
2022-03-04 19:29:14 +01:00
Sebastiaan van Stijn
77d8292e5d
Merge pull request #43328 from thaJeztah/bump_containerd_1.5.10
vendor: github.com/containerd/containerd v1.5.10
2022-03-04 19:20:30 +01:00
Sebastiaan van Stijn
b4a943afab
vendor: github.com/containerd/containerd v1.5.10
full diff: https://github.com/containerd/containerd/compare/v1.5.9...v1.5.10

relevant changes in vendored code:

- Use readonly mount to read user/group info

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-04 18:07:09 +01:00
Sebastiaan van Stijn
e781cf5f64
update to go 1.17.8 to address CVE-2022-24921
Addresses [CVE-2022-24921](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24921)

go1.17.8 (released 2022-03-03) includes a security fix to the regexp/syntax package,
as well as bug fixes to the compiler, runtime, the go command, and the crypto/x509,
and net packages. See the Go 1.17.8 milestone on the issue tracker for details:

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

full diff: https://github.com/golang/go/compare/go1.17.7...go1.17.8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-04 16:36:56 +01:00
Sebastiaan van Stijn
a0230f3d9a
remove unneeded "digest" alias for "go-digest"
I think this was there for historic reasons (may have been goimports expected
this, and we used to have a linter that wanted it), but it's not needed, so
let's remove it (to make my IDE less complaining about unneeded aliases).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-04 14:49:42 +01:00
Sebastiaan van Stijn
06df530b6d
image: improve godoc for V1Image
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-03 22:57:03 +01:00
Sebastiaan van Stijn
34c2c14775
api: improve godoc for ImageInspect struct
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-03 22:55:34 +01:00
Sebastiaan van Stijn
d19dd22257
api: docs: fix warning about comment indentation (API v1.40-v1.41)
5428:7 warning comment not indented like content (comments-indentation)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-03 22:55:32 +01:00
Sebastiaan van Stijn
9565606222
api: docs: update docs for /images/{name}/json (API v1.39-v1.41)
- rename definition in swagger from `Image` to `ImageInspect` to match the go type
- improve (or add) documentation for various fields
- move example values in-line in the "definitions" section
- remove the `required` fields from `ImageInspect`, as the type is only used as
  response type (not to make requests).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-03 22:55:25 +01:00
Sebastiaan van Stijn
697f42582a
api: docs: fix warning about comment indentation (current API version)
5428:7    warning  comment not indented like content  (comments-indentation)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-03 22:50:17 +01:00
Sebastiaan van Stijn
3193d7e101
api: docs: update docs for /images/{name}/json (current API version)
- rename definition in swagger from `Image` to `ImageInspect` to match the go type
- improve (or add) documentation for various fields
- move example values in-line in the "definitions" section
- remove the `required` fields from `ImageInspect`, as the type is only used as
  response type (not to make requests).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-03 22:50:10 +01:00
Sebastiaan van Stijn
3e8bfcc9f2
Merge pull request #43263 from thaJeztah/daemon_config_tweak
daemon/config: DefaultShmSize: minor tweak and improve docs
2022-03-03 21:24:28 +01:00
Sebastiaan van Stijn
eac029c868
Merge pull request #43264 from thaJeztah/fix_TestSlowStdinClosing
integration-cli: TestSlowStdinClosing: add logs, and potential naming conflict
2022-03-03 21:22:41 +01:00
Cory Snider
90c54320c8 daemon/logger: fix data race in LogFile
The log message's timestamp was being read after it was returned to the
pool. By coincidence the timestamp field happened to not be zeroed on
reset so much of the time things would work as expected. But if the
message value was to be taken back out of the pool before WriteLogEntry
returned, the timestamp recorded in the gzip header of compressed
rotated log files would be incorrect.

Make future use-after-put bugs fail fast by zeroing all fields of the
Message value, including the timestamp, when it is put into the pool.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-03-03 14:56:25 -05:00
Cory Snider
9080e5a1f7 daemon/logger: add test to detect data races
Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-03-03 14:56:25 -05:00
Sebastiaan van Stijn
c8cf4517fc
Merge pull request #43309 from thaJeztah/daemon_refactor_statecounter
daemon: SystemInfo() extract collecting data to more helper functions
2022-03-03 20:49:27 +01:00
Sebastiaan van Stijn
61c6a4792a
Merge pull request #43318 from thaJeztah/layer_remove_unused_error
layer: remove unused ErrActiveMount, ErrNotMounted, ErrNotSupported
2022-03-03 20:45:49 +01:00
Brian Goff
c8eff73fff
Merge pull request #43297 from thaJeztah/registry_add_DefaultRegistryHost_const
registry: add DefaultRegistryHost const, and improve documentation
2022-03-03 11:19:29 -08:00
Sebastiaan van Stijn
36ec581e5c
Merge pull request #43277 from thaJeztah/fix_kernelmem_docs_and_error
api: add missing docs for KernelMemoryTCP, and fix error message
2022-03-03 19:33:49 +01:00
Sebastiaan van Stijn
4b9931f58f
Merge pull request #43320 from thaJeztah/move_EnsureRemoveAll
pkg/system: move EnsureRemoveAll() to pkg/containerfs
2022-03-03 07:39:42 +01:00
Sebastiaan van Stijn
dee9f422c8
pkg/system: remove github.com/docker/go-units dependency
This is not "very" important, but this dependency was only used
for a single const, which could be satisfied with a comment.

Not very urgent, as github.com/docker/go-units is likely imported
through other ways already (but it's nice to have the package be
more isolated).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-03 00:22:32 +01:00
Sebastiaan van Stijn
25ee00c494
pkg/system: move EnsureRemoveAll() to pkg/containerfs
pkg/system historically has been a bit of a kitchen-sink of things that were
somewhat "system" related, but didn't have a good place for. EnsureRemoveAll()
is one of those utilities. EnsureRemoveAll() is used to both unmount and remove
a path, for which it depends on both github.com/moby/sys/mount, which in turn
depends on github.com/moby/sys/mountinfo.

pkg/system is imported in the CLI, but neither EnsureRemoveAll(), nor any of its
moby/sys dependencies are used on the client side, so let's move this function
somewhere else, to remove those dependencies from the CLI.

I looked for plausible locations that were related; it's used in:

- daemon
- daemon/graphdriver/XXX/
- plugin

I considered moving it into a (e.g.) "utils" package within graphdriver (but not
a huge fan of "utils" packages), and given that it felt (mostly) related to
cleaning up container filesystems, I decided to move it there.

Some things to follow-up on after this:

- Verify if this function is still needed (it feels a bit like a big hammer in
  a "YOLO, let's try some things just in case it fails")
- Perhaps it should be integrated in `containerfs.Remove()` (so that it's used
  automatically)
- Look if there's other implementations (and if they should be consolidated),
  although (e.g.) the one in containerd is a copy of ours:
  https://github.com/containerd/containerd/blob/v1.5.9/pkg/cri/server/helpers_linux.go#L200

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-03 00:22:26 +01:00
Sebastiaan van Stijn
d492101172
daemon: SystemInfo() extract collecting debugging information to a helper
This makes it more inline with other data we collect, and can be used to make
some info optional at some point.

fillDebugInfo sets the current debugging state of the daemon, and additional
debugging information, such as the number of Go-routines, and file descriptors.

Note that this currently always collects the information, but the CLI only
prints it if the daemon has debug enabled. We should consider to either make
this information optional (cli to request "with debugging information"), or
only collect it if the daemon has debug enabled. For the CLI code, see
https://github.com/docker/cli/blob/v20.10.12/cli/command/system/info.go#L239-L244

Additional note: the CLI considers info.SystemTime debugging information. This
felt a bit "odd" (daemon time could be useful for standard use), so I left this
out of this function.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-02 22:19:24 +01:00
Sebastiaan van Stijn
ac2cd5a8f2
daemon: unexport Daemon.ID and Daemon.RegistryService
These are used internally only, and set by daemon.NewDaemon(). If they're
used externally, we should add an accessor added (which may be something
we want to do for daemon.registryService (which should be its own backend)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-02 22:19:22 +01:00
Sebastiaan van Stijn
a27f8aecad
daemon: SystemInfo() extract container counts to a helper function
This makes it more inline with other data we collect, and can be used to
make some info optional at some point.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-02 22:19:20 +01:00
Sebastiaan van Stijn
82f96da04d
layer: remove unused ErrActiveMount, ErrNotMounted, ErrNotSupported
These errors were added in 500e77bad0, but were
never used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-02 21:30:41 +01:00
Sebastiaan van Stijn
e8a0a545e7
Merge pull request #43308 from thaJeztah/bump_more_buildkit_deps
vendor: update more dependencies in preparation of buildkit and containerd update
2022-03-02 20:08:33 +01:00
Sebastiaan van Stijn
de0eabbd66
vendor: github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f
full diff: db3c7e526a...2eb08e3e57

- Add support for detecting netns for all possible QoS in Kubernetes
- Add go1.10 build constraint

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-01 22:58:47 +01:00
Sebastiaan van Stijn
d8e1746466
vendor: github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274
full diff: d72af97c0e...b19f7f9cb2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-01 22:41:22 +01:00
Sebastiaan van Stijn
931b455f27
vendor: github.com/hashicorp/errwrap v1.1.0
deprecates `errwrap.Wrapf()`

That function appears to be still used by `go-multierror.Prefix()`);
https://github.com/hashicorp/go-multierror/blob/v1.1.1/prefix.go#L30-L35
which itself is only used in a single place in `containerd/pkg/process`:
https://github.com/containerd/containerd/blob/v1.5.9/pkg/process/io.go#L438

full diff: https://github.com/hashicorp/errwrap/compare/v1.0.0...v1.1.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-01 18:06:12 +01:00
Sebastiaan van Stijn
4d1c323796
vendor: golang.org/x/text v0.3.7
full diff: https://github.com/golang/text/compare/v0.3.6...v0.3.7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-01 18:04:19 +01:00
Sebastiaan van Stijn
7f9c77b2fe
vendor: golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
full diff: 6f1e639406...2bc19b1117

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-01 18:03:34 +01:00
Sebastiaan van Stijn
a69cda092b
vendor: golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
no changes in vendored code

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-01 18:02:03 +01:00
Sebastiaan van Stijn
c03ae0b726
vendor: github.com/cespare/xxhash/v2 v2.1.2
full diff: https://github.com/cespare/xxhash/compare/v2.1.1...v2.1.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-01 18:00:17 +01:00
Sebastiaan van Stijn
2634edec6e
vendor: github.com/klauspost/compress v1.14.3
full diff: https://github.com/klauspost/compress/compare/v1.14.2...v1.14.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-01 17:57:38 +01:00
Sebastiaan van Stijn
8bf694b427
vendor: github.com/google/go-cmp v0.5.7
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-01 17:04:32 +01:00
Sebastiaan van Stijn
89d39e5e77
vendor: gotest.tools/v3 v3.1.0
full diff: https://github.com/gotestyourself/gotest.tools/compare/v3.0.3...v3.1.0

noteworthy changes:

- ci: add go1.16
- ci: add go1.17, remove go1.13
- golden: only create dir if update flag is set
- icmd: replace all usages of os/exec with golang.org/x/sys/execabs
- assert: ErrorIs
- fs: add DirFromPath
- Stop creating directory outside of testdata
- fs: Fix comparing symlink permissions

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-01 17:02:53 +01:00
Sebastiaan van Stijn
c35143f92e
vendor: github.com/moby/sys/mount v0.3.1
full diff: https://github.com/moby/sys/compare/mount/v0.3.0...mount/v0.3.1

- mount: fix unused/deadcode warnings on Mac
- mount: bump mountinfo to v0.6.0
- Makefile: rm .SHELLFLAGS, add set -e

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-01 17:02:07 +01:00
Sebastiaan van Stijn
b7310e6d13
Merge pull request #43303 from cuishuang/master
all: fix typos
2022-03-01 13:39:48 +01:00
cuishuang
9efa8b3500 all: fix typos
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-03-01 14:26:35 +08:00
Sebastiaan van Stijn
7d70d95d8e
registry: add DefaultRegistryHost const, and improve documentation
This is more in line with other consts that are used for defaults, and makes it
slightly easier to consume than DefaultV2Registry, e.g. see:
https://github.com/oras-project/oras-go/blob/v1.1.0/pkg/auth/docker/resolver.go#L81-L84

Note that both the "index.docker.io" and "registry-1.docker.io" domains
are here for historic reasons and backward-compatibility. These domains
are still supported by Docker Hub (and will continue to be supported), but
there are new domains already in use, and plans to consolidate all legacy
domains to new "canonical" domains. Once those domains are decided on, we
should update these consts (but making sure to preserve compatibility with
existing installs, clients, and user configuration).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-02-27 13:48:27 +01:00
Akihiro Suda
d809ad98e3
Merge pull request #43183 from thaJeztah/cleanup_distribution
distribution/xfer: refactor to reduce public api/interface
2022-02-26 23:50:03 +09:00
Tianon Gravi
c549116f32
Merge pull request #43280 from thaJeztah/remove_deprecated_dualstack
distribution: remove use of deprecated dial.DualStack
2022-02-25 16:22:49 -08:00