7390 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
30a365f543 docs/api: version-history.md: fix markdown
Fixes a typo introduced in 1932091e21

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-16 21:57:05 +01:00
Sebastiaan van Stijn
4e9df46a6e docs/api: document correct case for Api-Version header
This header is sent in its canonical format; update the docs to
reflect this.

Follow-up to 76a5ca1d4d

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-16 14:06:09 +01:00
Sebastiaan van Stijn
5c358743af daemon: info: remove bridge-nf-call-iptables / ip6tables warnings
Historically, the `bridge` network-driver would detect whether netfiltering
was enabled in the kernel or, if disabled, try to do a `modprobe` when
initializing the driver. This approach became problematic, as loading the
module was not always performed  at startup depending on daemon configuration,
or the daemon may have failed to load the module. The `/info` response
would include a warning  to inform the user that some functionality may not
be available;

    WARNING: bridge-nf-call-iptables is disabled
    WARNING: bridge-nf-call-ip6tables is disabled

Starting with db25b0dcd0, detecting whether
netfiltering  is enabled now [happens when needed][1], which was further improved
on to not depend  on `modprobe` in 264c15bfc4 and
4740820716.

Because of the above, the `/info` output would now return warnings in any
situation where netfiltering was not enabled on the host before the daemon
started, which may be either _incorrect_ (i.e., the module may have been
loaded afterwards), or irrelevant, because netfiltering is not needed in
all situations.

This patch removes the warnings from the `/info` response,

[1]: 944e403502/libnetwork/drivers/bridge/setup_bridgenetfiltering.go (L16-L77)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-13 10:09:41 +01:00
Sebastiaan van Stijn
8b243a1a82 docs/api: deprecate non-distributable artifacts
Mark the AllowNondistributableArtifactsCIDRs and AllowNondistributableArtifactsHostnames
fields as deprecated in all API versions, as these fields will
no longer be propagated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-11 20:30:00 +01:00
Sebastiaan van Stijn
1932091e21 remove support for non-distributable artifacts and deprecate API fields and config
Non-distributable artifacts (foreign layers) were introduced in commit
05bd04350b to accommodate Windows images,
for which the EULA did not allow layers to be distributed through registries
other than those hosted by Microsoft. The concept of foreign / non-distributable
layers was adopted by the OCI distribution spec in [oci#233].

These restrictions were relaxed later to allow distributing these images
through non-public registries, for which a configuration was added in the
daemon in 67fdf574d5. In 2022, Microsoft updated
the EULA and [removed these restrictions altogether][1], and the OCI distribution
spec deprecated the  functionality in [oci#965].

In 2023, Microsoft [removed the use of foreign data layers][2] for their images,
making this functionality obsolete.

This patch:

- Deprecates the `--allow-nondistributable-artifacts` daemon flag and corresponding
  `allow-nondistributable-artifacts` field in `daemon.json`. Setting either
  option will no longer take an effect, but a deprecation warning log is added
  to raise awareness about the deprecation. This warning is planned to become
  an error in the next release.
- Deprecates the `RegistryConfig.AllowNondistributableArtifactsCIDRs` and
  `RegistryConfig.AllowNondistributableArtifactsHostnames` fields in the
  `GET /info` API response. For API version v1.48 and lower, the fields are
  still included in the response, but always `null`. In API version v1.49 and
  higher, the field will be omitted entirely.
- Deprecates the `api/types/registry/ServiceConfig.AllowNondistributableArtifactsCIDRs`
  field.
- Deprecates the `api/types/registry/ServiceConfig.AllowNondistributableArtifactsHostnames`
  field.
- Deprecates the `registry.ServiceOptions.AllowNondistributableArtifacts` field.

[oci#233]: https://github.com/opencontainers/image-spec/pull/233
[oci#965]: https://github.com/opencontainers/image-spec/pull/965
[1]: https://techcommunity.microsoft.com/blog/containers/announcing-windows-container-base-image-redistribution-rights-change/3645201
[2]: https://techcommunity.microsoft.com/blog/containers/announcing-removal-of-foreign-layers-from-windows-container-images/3846833

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-11 20:29:46 +01:00
Sebastiaan van Stijn
27294df576 api/server: Server.CreateMux: also register API-version debug endpoints
The debug endpoints are currently only provided non-versioned (e.g. `/debug/vars`).
While this is convenient, we "officially" deprecated non-versioned endpoints
in the API.

This patch also registers the debug-endpoints under the API-versioned paths,
so that they can be used either without version ("latest") and versioned
paths.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-09 15:55:25 +01:00
Albin Kerouanton
5b752fab32 api: add Priority field to EndpointSettings
This new field is used by libnetwork to determine which endpoint
provides the default gateway for a container.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-11-28 17:06:26 +01:00
Paweł Gronowski
44ed3067ca c8d/container/inspect: Return ImageManifestDescriptor
`ImageManifestDescriptor` will contain an OCI descriptor of
platform-specific manifest of the image that was picked when creating
the container.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-11-19 13:55:56 +01:00
Paweł Gronowski
d88ab0f3a2 c8d/image/inspect: Return Descriptor
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-11-18 13:00:44 +01:00
Rob Murray
5ef5ca3adc EnableIPv4 will be in API 1.48, not 1.47
Numbering has changed since commit d4d8611164

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-11-15 18:21:25 +00:00
Paweł Gronowski
b15cd283d8 c8d/list: Return Descriptor
While the endpoint returns a detailed information about its children, it
doesn't actually expose the descriptor of the root OCI index/manifest
list.
This commits adds the target description to the returned JSON.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-11-13 15:02:18 +01:00
Paweł Gronowski
5014c90516 api/swagger: Improve description for platform in images/push
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-11-06 13:14:20 +01:00
Sebastiaan van Stijn
cb966073ce container create: add warning for volumeDriver together with mounts
commit 77fe35b3b9 added a warning if the
"volumeDriver" option was used in combination with --mount.

That change put the warning in the CLI, which should not have to handle
this logic. Let's move it to the daemon as we have a warnings response
in the container create response.

The warning is gated by API version, so that older clients can continue
to produce the warning client-side.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-29 12:16:48 +01:00
Rob Murray
533e7d150a From 28.0.0, don't migrate per-endpoint sysctls.
Re-add checks that were removed until 28.0.0's API version was
known, in commit 17adc1478b

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-10-24 12:20:01 +01:00
Sebastiaan van Stijn
28925c9175 Merge pull request #48653 from thaJeztah/docs_update_api_links
update links to API documentation
2024-10-15 14:51:28 +02:00
Sebastiaan van Stijn
d9627b6159 docs: api: document w (width) and h (height) query params as required
Query parameters default to being _optional_ in swagger, but for these
endpoints, they were required. Omitting these parameters (or passing an
empty value) produces a 400 (bad request);

    docker run -d --name foo nginx:alpine

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/containers/foo/resize'
    {"message":"strconv.Atoi: parsing \"\": invalid syntax"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/containers/foo/resize?w='
    {"message":"strconv.Atoi: parsing \"\": invalid syntax"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/containers/foo/resize?w=&h='
    {"message":"strconv.Atoi: parsing \"\": invalid syntax"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/containers/foo/resize?w=100&h='
    {"message":"strconv.Atoi: parsing \"\": invalid syntax"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/containers/foo/resize?w=100&h=100'

This patch updates the swagger to reflect that these parameters are required.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-14 20:12:07 +02:00
Sebastiaan van Stijn
0f8f143a27 docs/api: version-history: update documentation links
URLs were updated on docs.docker.com

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-12 17:22:30 +02:00
Sebastiaan van Stijn
ff191c58f7 api: info: deprecate "Commit.Expected" fields
The `Commit` type was introduced in 2790ac68b3,
to assist triaging issues that were reported with an incorrect version of
runc or containerd. At the time, both `runc` and `containerd` were not yet
stable, and had to be built from a specific commit to guarantee compatibility.

We encountered various situations where unexpected (and incompatible) versions
of those binaries were packaged, resulting in hard to trace bug-reports.
For those situations, a "expected" version was set at compile time, to
indicate if the version installed was different from the expected version;

    docker info
    ...
    runc version: a592beb5bc4c4092b1b1bac971afed27687340c5 (expected: 69663f0bd4b60df09991c08812a60108003fa340)

Both `runc` and `containerd` are stable now, and docker 19.03 and up set the
expected version to the actual version since c65f0bd13c
and 23.0 did the same for the `init` binary b585c64e2b,
to prevent the CLI from reporting "unexpected version".

In short; the `Expected` fields no longer serves a real purpose.

In future, we can even consider deprecating the `ContainerdCommit`, `RuncCommit`
and `InitCommit` fields on the `/info` response (as we also include this
information as part of the components returned in `/version`), but those
can still be useful currently for situations where a user only provides
`docker info` output.

This patch starts with deprecating the `Expected` field.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-12 19:40:12 +02:00
Paweł Gronowski
f143f4ec51 image/save&load: Support Platform parameter
Add `Platform` parameter that allows to select a specific platform to
save/load.

This is a breaking change to the Go client as it changes the signatures
of `ImageLoad` and `ImageSave`.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-09-11 19:44:35 +02:00
Paweł Gronowski
ab075ecd10 image/history: Support Platform parameter
Add `Platform` parameter that allows to select a specific platform to
show the history for.

This is a breaking change to the Go client as it changes the signature
of `ImageHistory`.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-09-11 19:44:32 +02:00
Sebastiaan van Stijn
2b43979395 API: bump version to 1.48
The 27.x branch was created and is on API 1.47, so changes in master/main
should now be targeting the next version of the API (1.48).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-11 10:18:55 +02:00
Sebastiaan van Stijn
47855a7b4e Merge pull request #48443 from thaJeztah/fix_push_docs
api: swagger: fix documentation for image push endpoint
2024-09-11 10:13:36 +02:00
Sebastiaan van Stijn
09fc6ab2d9 docs/api: update deprecation version for erroneous fields (v1.46, v1.47)
commit af0cdc36c7 officially marked these
fields as deprecated and to be removed in API v1.47 (which was targeted
for v28.0). We shipped v1.47 with the v27.2 release, but did not yet
remove the erroneous fields.

This patch updates the version to v1.48.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-09 14:45:00 +02:00
Sebastiaan van Stijn
aca38a4218 docs: api: fix documentation for image push endpoint (API v1.25-v1.47)
The documentation was incorrect and didn't properly document the use of
tags;

- Image push currently only accepts an image-name, not an ID / digest.
- When giving a name, it's expected to be without tag included; when
  including a tag, it is ignored.
- The tag parameter is required when pushing a single image (i.e., it
  does not default to "latest"); omitting the tag parameter will push
  all tags of the given image.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-09 14:33:50 +02:00
Nathan Baulch
59eba0ae13 Fix typos
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-06 21:53:09 +10:00
Paweł Gronowski
4e0d1dfc17 docs/api: add documentation for API v1.47
API version used by the v27.2.0 release.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-09-03 11:58:17 +02:00
Paweł Gronowski
d770efd851 Merge pull request #48275 from thaJeztah/swagger_fix_nullable
api/swagger: fix x-nullable for SystemInfo.Containerd (api v1.46)
2024-08-09 09:59:56 +02:00
Paweł Gronowski
050afe1e1a api/list: Expose manifests
Add `Manifests` field to `ImageSummary` which exposes all image
manifests (which includes other blobs using the image media type, like
buildkit attestations).

There's also a new `manifests` query field that needs to be set in order
for the response to contain the new information.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-07 13:48:54 +02:00
Rob Murray
a86a9e3aa4 API 1.46: end per-interface sysctl migration in major release
Rather than in API 1.47.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-08-01 10:51:24 +01:00
Rob Murray
17adc1478b Migrate per-endpoint sysctls until 28.0.0
Commit 0071832226 introduced
per-endpoint sysctls, and migration to them from the top-level
'--sysctl' option.

The migration was intended to be short-term, disabled in the
next major release and code was added to check for the next
API version. But now, the API version will be bumped in a
minor release - this breaking change needs to wait until the
next major release, and we don't yet know the API version
number for that.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-08-01 10:26:06 +01:00
Rob Murray
d4d8611164 Added API create/inspect option EnableIPv4
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-07-31 18:38:43 +01:00
Sebastiaan van Stijn
c7dec1c67a docs/api: swagger: fix x-nullable for SystemInfo.Containerd (api v1.46)
This field was added in 812f319a57, but it
looks like redoc doesn't like the field in this location, producing a
warning.

Rendering the docs (`make swagger-docs`) showed a warning:

> Warning: Other properties are defined at the same level as $ref at
> "#/definitions/SystemInfo/properties/Containerd". They are IGNORED
> according to the JsonSchema spec

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-31 12:39:07 +02:00
Rob Murray
a23dcf4798 Bump API version to 1.47
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-07-30 14:30:26 +01:00
Paweł Gronowski
7f04a603f6 docs/api: Add missing `
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-07-11 14:24:25 +02:00
Sebastiaan van Stijn
ce5571f343 api: swagger: fix definition of TmpFsOptions (API v1.46)
Since it's a [][]string, there should only be two levels of array
in the OpenAPI spec. Also, the outermost level array shouldn't have
properties: (it should have items: instead).

Co-authored-by: Mark Yen <mark.yen@suse.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-21 09:17:57 +02:00
Sebastiaan van Stijn
39b4448e12 docs/api: update some example values to be more accurate (API v1.46)
Update daemon versions, and minimum supported API version to be more
representative to what the API would return.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-19 00:51:14 +02:00
Sebastiaan van Stijn
b06b6b3648 docs: add API documentation for API v1.46
This is the API version to be released with v27.0, and the API
is now frozen for this release, so we can create the documentation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-18 14:15:13 +02:00
Sebastiaan van Stijn
4ea464d1a7 Merge pull request #47950 from psaintlaurent/ENGINE-903
Add OOMScoreAdj to the moby API
2024-06-17 22:58:24 +02:00
plaurent
b640582436 Add OomScoreAdj options
Signed-off-by: plaurent <patrick@saint-laurent.us>
2024-06-17 12:01:06 -04:00
Paweł Gronowski
caf502a0bc Merge pull request #47239 from cpuguy83/containerd_image_info
Set containerd container image ref
2024-06-17 17:02:24 +02:00
Brian Goff
812f319a57 Add containerd connection info to info endpoint (API v1.46)
This will be used in the next commit to test that changes are propagated
to the containerd store.
It is also just generally useful for debugging purposes.

- docs/api: update version history
- daemon: add fillContainerdInfo utility
- api: update swagger file with new types

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-17 14:43:39 +02:00
Paweł Gronowski
7b8f4922a5 daemon: Emit Image Create event when image is built
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-06-17 14:05:12 +02:00
Arash Deshmeh
dd1ca95ef9 Add exec option to API TmpfsOptions
Includes two commits from Arash Deshmeh:

add exec option to API TmpfsOptions and the related volume functions

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>

feature: daemon handles tmpfs mounts exec option

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>

Updated by Drew Erny

Signed-off-by: Drew Erny <derny@mirantis.com>
2024-06-14 12:11:20 -05:00
Sebastiaan van Stijn
22c212d208 Merge pull request #47941 from thaJeztah/api_image_inspect_deprecate_fields
api: deprecate erroneous Config fields in `GET /images/{name}/json` response
2024-06-10 19:19:04 +02:00
Sebastiaan van Stijn
1513068d8c Merge pull request #47679 from vvoland/c8d-multiplatform-push
c8d/push: Support `--platform` switch
2024-06-10 18:38:47 +02:00
Sebastiaan van Stijn
af0cdc36c7 api: deprecate erroneous Config fields in GET /images/{name}/json response
The `Config` field returned by this endpoint (used for "image inspect") returns
additional fields that are not part of the image's configuration and not part of
the [Docker Image Spec] and the [OCI Image Spec].

These additional fields are included in the response, due to an
implementation detail, where the [api/types.ImageInspec] type used
for the response is using the [container.Config] type.

The [container.Config] type is a superset of the image config, and while the
image's Config is used as a _template_ for containers created from the image,
the additional fields are set at runtime (from options passed when creating
the container) and not taken from the image Config.

These fields are never set (and always return the default value for the type),
but are not omitted in the response when left empty. As these fields were not
intended to be part of the image configuration response, they are deprecated,
and will be removed from the API.

The following fields are currently included in the API response, but
are not part of the underlying image's Config, and deprecated:

- `Hostname`
- `Domainname`
- `AttachStdin`
- `AttachStdout`
- `AttachStderr`
- `Tty`
- `OpenStdin`
- `StdinOnce`
- `Image`
- `NetworkDisabled` (already omitted unless set)
- `MacAddress` (already omitted unless set)
- `StopTimeout` (already omitted unless set)

[Docker image spec]: https://github.com/moby/docker-image-spec/blob/v1.3.1/specs-go/v1/image.go#L19-L32
[OCI Image Spec]: https://github.com/opencontainers/image-spec/blob/v1.1.0/specs-go/v1/config.go#L24-L62
[api/types.ImageInspec]: https://github.com/moby/moby/blob/v26.1.4/api/types/types.go#L87-L104
[container.Config]: https://github.com/moby/moby/blob/v26.1.4/api/types/container/config.go#L47-L82

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-10 16:56:17 +02:00
Sebastiaan van Stijn
58641c7b5c docs: api: use separate definition for Image.Config (api v1.39 - v1.45)
The Image.Config field currently reuses the ContainerConfig definition,
matching the Go implementation, which also uses that type.

However, the ContainerConfig type contains various fields that are not
part of the image config, and would never be set. The Image.Config is
used as template / default values for containers started from the image,
but will only use the fields that are part of the [Docker image spec].

This patch updates the swagger files used in the documentation to use a
separate `ImageConfig` definition for the Image.Config field. The new
definition is a copy of the existing `ContainerConfig` type, but with
updated descriptions for fields, and with an example response that omits
the fields that should not be used.

The following fields are currently included in the `Config` field of the API
response, but are not part of the underlying image's config:

- `Hostname`
- `Domainname`
- `AttachStdin`
- `AttachStdout`
- `AttachStderr`
- `Tty`
- `OpenStdin`
- `StdinOnce`
- `Image`
- `NetworkDisabled` (already omitted unless set)
- `MacAddress` (already omitted unless set)
- `StopTimeout` (already omitted unless set)

[Docker image spec]: https://github.com/moby/docker-image-spec/blob/v1.3.1/specs-go/v1/image.go#L19-L32

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-10 15:38:18 +02:00
Paweł Gronowski
0a31437208 c8d/push: Support platform selection
Add a OCI platform fields as parameters to the `POST /images/{id}/push`
that allow to specify a specific-platform manifest to be pushed instead
of the whole image index.

When no platform was requested and pushing whole index failed, fallback
to pushing a platform-specific manifest with a best candidate (if it's
possible to choose one).

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-06-10 13:35:13 +02:00
Sebastiaan van Stijn
ac27a5379b docs: api: image inspect: remove Container and ContainerConfig
The Container and ContainerConfig fields have been deprecated, and removed
since API v1.45 in commit 03cddc62f4.

This patch fixes the swagger and documentation to no longer mention them
as they are no longer returned by API v1.45 and higher.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-09 23:17:37 +02:00
cncal
ca0529f984 api/server: ContainerList returns container annotations
Allow clients (e.g. cri-dockerd) to fetch container annotations in
ContainerList api.

Signed-off-by: cncal <flycalvin@qq.com>
2024-06-07 09:50:11 +08:00