Commit graph

46305 commits

Author SHA1 Message Date
Bjorn Neergaard
be220af9fb
Merge pull request #44395 from jmrouet/master
Fixing dockerd-rootless-setuptools.sh when user name contains a backslash
2023-05-12 09:39:29 -06:00
Sebastiaan van Stijn
bafcfdf8c5
Merge pull request #45484 from thaJeztah/remove_deprecated_stubs
remove deprecated types, fields, and functions
2023-05-12 14:03:26 +01:00
Sebastiaan van Stijn
5d5f2e3a93
Merge pull request #45530 from rumpl/fix-empty-auth-pull
c8d: The authorizer needs to be set even if AuthConfig is empty
2023-05-12 10:48:27 +01:00
Djordje Lukic
348a79958d
c8d: The authorizer needs to be set even if AuthConfig is empty
Without the authorizer pulling will fail if the user is not logged-in

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-05-12 09:41:34 +02:00
Jean-Michel Rouet
2f0ba0a7e5 more robust dockerd-rootless-setuptools.sh
Fixing case where username may contain a backslash.
This case can happen for winbind/samba active directory domain users.

Signed-off-by: Jean-Michel Rouet <jean-michel.rouet@philips.com>

Use more meaningful variable name

Signed-off-by: Jean-Michel Rouet <jean-michel.rouet@philips.com>

Update contrib/dockerd-rootless-setuptool.sh

Co-authored-by: Akihiro Suda <suda.kyoto@gmail.com>
Signed-off-by: Jean-Michel Rouet <jean-michel.rouet@philips.com>

Use more meaningful variable name

Signed-off-by: Jean-Michel Rouet <jean-michel.rouet@philips.com>

Update contrib/dockerd-rootless-setuptool.sh

Co-authored-by: Akihiro Suda <suda.kyoto@gmail.com>
Signed-off-by: Jean-Michel Rouet <jean-michel.rouet@philips.com>
2023-05-12 09:22:14 +02:00
Akihiro Suda
9e6370819b
Merge pull request #45473 from zhangguanzhang/master-commentStr
[builder] make chownComment easy to read
2023-05-12 09:35:10 +09:00
Tianon Gravi
46ce4ec8cf
Merge pull request #45322 from laurazard/c8d-upstream-classic-builder
c8d: implement classic builder
2023-05-11 18:10:21 +00:00
Sebastiaan van Stijn
9983d896de
Merge pull request #45519 from crazy-max/bin-image
bin-image bake target
2023-05-11 18:07:35 +02:00
Sebastiaan van Stijn
7c43e8c45a
Merge pull request #45513 from thaJeztah/client_remove_uses_of_IsErrNotFound
client: make IsErrNotFound an alias for errdefs.IsNotFound, clean-up assertions on tests
2023-05-11 17:42:15 +02:00
Sebastiaan van Stijn
f0791afade
Merge pull request #45517 from vvoland/c8d-authconfig-default
c8d: Better handling of partially filled `AuthConfig`
2023-05-11 17:38:17 +02:00
CrazyMax
135d8f04f9
ci: bin-image workflow
This workflow will just build the bin-image bake target.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-05-11 15:52:41 +02:00
Kevin Alvarez
ae1ca67178
bin-image bake target
Allows to build a non-runnable image that contains bundles.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-05-11 15:52:41 +02:00
Sebastiaan van Stijn
d922f94d93
Merge pull request #45516 from thaJeztah/vendor_distribution_v2.8.2-beta.2
vendor: github.com/docker/distribution v2.8.2-beta.2
2023-05-11 14:59:44 +02:00
Paweł Gronowski
3309e45ca1
c8d: Don't create authorizer for empty AuthConfig
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-05-11 14:32:46 +02:00
Paweł Gronowski
2ad499f93e
c8d/authorizer: Default to docker.io
When the `ServerAddress` in the `AuthConfig` provided by the client is
empty, default to the default registry (registry-1.docker.io).

This makes the behaviour the same as with the containerd image store
integration disabled.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-05-11 14:17:57 +02:00
Laura Brehm
bd6868557d
c8d/builder: implement cache
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-05-11 12:02:09 +01:00
Sebastiaan van Stijn
7821d2d788
vendor: github.com/docker/distribution v2.8.2
CI

- Dockerfile: fix filenames of artifacts

Bugfixes

-  Fix panic in inmemory driver
-  Add code to handle pagination of parts. Fixes max layer size of 10GB bug
-  Parse http forbidden as denied
-  Revert "registry/client: set Accept: identity header when getting layers

Runtime

- Update to go1.19.9
- Dockerfile: update xx to v1.2.1 ([#3907](https://github.com/distribution/distribution/pull/3907))

Security

- Fix [CVE-2022-28391](https://www.cve.org/CVERecord?id=CVE-2022-28391) by bumping alpine from 3.14 to 3.16
- Fix [CVE-2023-2253](https://www.cve.org/CVERecord?id=CVE-2023-2253) runaway allocation on /v2/_catalog [`521ea3d9`](521ea3d973)

full diff: https://github.com/docker/distribution/compare/v2.8.1...v2.8.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

bump to release/2.8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-11 12:58:52 +02:00
Laura Brehm
e46674b6a7
c8d: implement classic builder
Co-authored-by: Djordje Lukic <djordje.lukic@docker.com>
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-05-11 11:57:01 +01:00
Brian Goff
e58c267d66
Merge pull request #45304 from crazy-max/buildkit-version-buildinfo
Set BuildKit version using buildinfo
2023-05-10 16:58:18 -07:00
Sebastiaan van Stijn
3b443c8cfc
Merge pull request #45508 from laurazard/c8d-dangling-image-history
c8d: image history – handle dangling images
2023-05-10 22:30:02 +02:00
Sebastiaan van Stijn
8d76acfe6c
testutil: replace uses of client.IsErrNotFound
The client no longer returns the old error-type, so we can use errdefs
instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-10 22:13:50 +02:00
Sebastiaan van Stijn
56fb56ccf0
integration: update error-assertions in tests
- use is.ErrorType
- replace uses of client.IsErrNotFound for errdefs.IsNotFound, as
  the client no longer returns the old error-type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-10 22:13:50 +02:00
Sebastiaan van Stijn
0538cdd226
integration-cli: update error-assertions in tests
- use is.ErrorType
- replace uses of client.IsErrNotFound for errdefs.IsNotFound, as
  the client no longer returns the old error-type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-10 22:13:50 +02:00
Sebastiaan van Stijn
66ff1e063e
client: update error-assertions in tests
- use is.ErrorType
- replace uses of client.IsErrNotFound for errdefs.IsNotFound, as
  the client no longer returns the old error-type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-10 22:13:38 +02:00
Sebastiaan van Stijn
685b3d820a
client: make IsErrNotFound an alias for errdefs.IsNotFound
None of the client will return the old error-types, so there's no need
to keep the compatibility code. We can consider deprecating this function
in favor of the errdefs equivalent this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-10 21:52:43 +02:00
Sebastiaan van Stijn
f70d9933d1
Merge pull request #45427 from laurazard/c8d-fix-incomplete-images
c8d: implement missing image delete logic
2023-05-10 18:01:45 +02:00
Sebastiaan van Stijn
9e817251a8
libnetwork/docs: fix broken link
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-10 12:05:05 +02:00
Sebastiaan van Stijn
17882ed614
libnetwork: update example in README.md
Align the example with the code updated in 4e0319c878.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-10 12:01:06 +02:00
Sebastiaan van Stijn
3f7fde76c2
Merge pull request #45507 from corhere/cleanup-reexec-inits
[chore] clean up reexec.Init() calls
2023-05-10 11:49:11 +02:00
Laura Brehm
4603b6d6b6
c8d: fix image history for dangling images
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-05-10 01:33:15 +01:00
Brian Goff
03885e1b00
Merge pull request #45490 from Jeyanthinath/consistent_alias
fixing consistent aliases for OCI spec imports
2023-05-09 16:33:32 -07:00
Cory Snider
4e0319c878 [chore] clean up reexec.Init() calls
Now that most uses of reexec have been replaced with non-reexec
solutions, most of the reexec.Init() calls peppered throughout the test
suites are unnecessary. Furthermore, most of the reexec.Init() calls in
test code neglects to check the return value to determine whether to
exit, which would result in the reexec'ed subprocesses proceeding to run
the tests, which would reexec another subprocess which would proceed to
run the tests, recursively. (That would explain why every reexec
callback used to unconditionally call os.Exit() instead of returning...)

Remove unneeded reexec.Init() calls from test and example code which no
longer needs it, and fix the reexec.Init() calls which are not inert to
exit after a reexec callback is invoked.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-05-09 19:13:17 -04:00
Sebastiaan van Stijn
b07d2a3827
Merge pull request #45486 from thaJeztah/daemon_monitor_logclean
daemon: handleContainerExit(): use logrus.WithFields
2023-05-10 00:51:50 +02:00
Bjorn Neergaard
9e43c11480
AUTHORS: regenerate
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-05-09 15:14:50 -06:00
Bjorn Neergaard
5fee4439a0
.mailmap: update with my new email
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-05-09 15:14:40 -06:00
Sebastiaan van Stijn
563fc92dd4
Merge pull request #45496 from thaJeztah/pkg_aaparser_deprecate_version
pkg/aaparser: deprecate GetVersion, as it's no longer used
2023-05-09 19:18:39 +02:00
Sebastiaan van Stijn
b587c5a2f8
Merge pull request #45501 from laurazard/c8d-image-history
c8d: add image history
2023-05-09 18:46:44 +02:00
Laura Brehm
e8be792130
c8d: fix missing image history
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-05-09 16:19:05 +01:00
Sebastiaan van Stijn
e3e715666f
pkg/aaparser: deprecate GetVersion, as it's no longer used
Our templates no longer contain version-specific rules, so this function
is no longer used. This patch deprecates it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 16:47:03 +02:00
Sebastiaan van Stijn
06221297bf
Merge pull request #45495 from thaJeztah/apparmor_remove_version_code
profiles/apparmor: remove use of aaparser.GetVersion()
2023-05-09 16:46:32 +02:00
Sebastiaan van Stijn
a8b1ce2447
Merge pull request #45492 from thaJeztah/contrib_apparmor_remove_version
contrib/apparmor: remove remaining version-conditionals (< 2.9) from template
2023-05-09 16:46:08 +02:00
Jeyanthinath Muthuram
71d7908656
added alias validation
Signed-off-by: Jeyanthinath Muthuram <jeyanthinath10@gmail.com>
2023-05-08 19:03:44 +05:30
Sebastiaan van Stijn
ecaab085db
profiles/apparmor: remove use of aaparser.GetVersion()
commit 7008a51449 removed version-conditional
rules from the template, so we no longer need the apparmor_parser Version.

This patch removes the call to `aaparser.GetVersion()`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-08 13:50:13 +02:00
Sebastiaan van Stijn
f445ee1e6c
contrib/apparmor: remove remaining version-conditionals (< 2.9) from template
Commit 2e19a4d56b removed all other version-
conditional statements from the AppArmor template, but left this one in place.

These conditions were added in 8cf89245f5
to account for old versions of debian/ubuntu (apparmor_parser < 2.9)
that lacked some options;

> This allows us to use the apparmor profile we have in contrib/apparmor/
> and solves the problems where certain functions are not apparent on older
> versions of apparmor_parser on debian/ubuntu.

Those patches were from 2015/2016, and all currently supported distro
versions should now have more current versions than that. Looking at the
oldest supported versions;

Ubuntu 18.04 "Bionic":

    apparmor_parser --version
    AppArmor parser version 2.12
    Copyright (C) 1999-2008 Novell Inc.
    Copyright 2009-2012 Canonical Ltd.

Debian 10 "Buster"

    apparmor_parser --version
    AppArmor parser version 2.13.2
    Copyright (C) 1999-2008 Novell Inc.
    Copyright 2009-2018 Canonical Ltd.

This patch removes the remaining conditionals.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-08 13:17:59 +02:00
Jeyanthinath Muthuram
307b09e7eb
fixing consistent aliases for OCI spec imports
Signed-off-by: Jeyanthinath Muthuram <jeyanthinath10@gmail.com>
2023-05-08 15:27:52 +05:30
Sebastiaan van Stijn
c651a53558
Merge pull request #45488 from doringeman/dorin.geman/execDuration-in-containerExit
daemon: handleContainerExit(): add execDuration in attributes
2023-05-08 11:14:28 +02:00
Sebastiaan van Stijn
d9d9950d8d
Merge pull request #45482 from thaJeztah/docs_api_fix_missing_endpoint
docs/api: version-history: also mention /system/df for VirtualSize
2023-05-08 11:03:40 +02:00
Dorin Geman
2ad37e1832 daemon: handleContainerExit(): add execDuration in attributes
Add `execDuration` field to the event attributes map. This is useful for tracking how long the container ran.

Signed-off-by: Dorin Geman <dorin.geman@docker.com>
2023-05-08 10:26:33 +03:00
Laura Brehm
cad97135b3
c8d: implement missing image delete logic
Ports over all the previous image delete logic, such as:
- Introduce `prune` and `force` flags
- Introduce the concept of hard and soft image delete conflics, which represent:
  - image referenced in multiple tags (soft conflict)
  - image being used by a stopped container (soft conflict)
  - image being used by a running container (hard conflict)
- Implement delete logic such as:
  - if deleting by reference, and there are other references to the same image, just
    delete the passed reference
  - if deleting by reference, and there is only 1 reference and the image is being used
    by a running container, throw an error if !force, or delete the reference and create
    a dangling reference otherwise
  - if deleting by imageID, and force is true, remove all tags (otherwise soft conflict)
  - if imageID, check if stopped container is using the image (soft conflict), and
    delete anyway if force
  - if imageID was passed in, check if running container is using the image (hard conflict)
  - if `prune` is true, and the image being deleted has dangling parents, remove them

This commit also implements logic to get image parents in c8d by comparing shared layers.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-05-08 02:32:03 +01:00
Sebastiaan van Stijn
de363f1404
daemon: handleContainerExit(): use logrus.WithFields
Use `WithFields()` instead of chaining multiple `WithField()` calls.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-07 21:24:34 +02:00