Commit Graph

3999 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
bb899c654a api/types: move RequestPrivilegeFunc to api/types/registry
Move the definition, but mostly keep it for documentation purposes,
to prevent having to import the registry package in all places.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-30 14:13:09 +02:00
Sebastiaan van Stijn
005b488506 api/types: fix non-constant format string in call (govet)
api/types/container/hostconfig.go:328:43: printf: non-constant format string in call to fmt.Errorf (govet)
                return &errInvalidParameter{fmt.Errorf(msg)}
                                                       ^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 10:41:58 +02:00
Sebastiaan van Stijn
0fd3a53c12 api/server/router: fix non-constant format string in call (govet)
api/server/router/container/container_routes.go:943:22: printf: non-constant format string in call to fmt.Fprintf (govet)
                fmt.Fprintf(conn, "HTTP/1.1 101 UPGRADED\r\nContent-Type: "+contentType+"\r\nConnection: Upgrade\r\nUpgrade: tcp\r\n\r\n")
                                  ^
    api/server/router/image/image_routes.go:144:50: printf: non-constant format string in call to github.com/docker/docker/pkg/streamformatter.FormatStatus (govet)
                output.Write(streamformatter.FormatStatus("", id.String()))
                                                              ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-27 10:41:46 +02:00
Sebastiaan van Stijn
e77e543b58 api/types/registry: fix godoc, and add some doc-links
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-13 14:36:55 +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
f3cf9359bd Merge pull request #47526 from vvoland/c8d-list-multiplatform
c8d: Multi-platform image list
2024-08-08 11:38:31 +02:00
Tianon Gravi
6b2b54c7f2 Merge pull request #48300 from vvoland/update-go-1.21.13
update to go1.21.13
2024-08-07 16:16:07 -07: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
Paweł Gronowski
85e9102dc9 api: Bump default version to 1.47
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-07 13:48:51 +02:00
Paweł Gronowski
efb3c50799 swagger: Disable ImageSummary model generation
Our version of go-swagger doesn't handle the `omitempty` correctly for
the new field.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-07 13:48:50 +02:00
Paweł Gronowski
b24c2e95e5 update to go1.21.13
- https://github.com/golang/go/issues?q=milestone%3AGo1.21.13+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.21.12...go1.21.13

go1.21.13 (released 2024-08-06) includes fixes to the go command, the
covdata command, and the bytes package. See the Go 1.21.13 milestone on
our issue tracker for details.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-07 11:45:08 +02:00
Rob Murray
1dd102e9b6 Merge pull request #48281 from robmry/remove_sysctl_migration_limit
Migrate per-endpoint sysctls until 28.0.0
2024-08-06 18:11:00 +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
Sebastiaan van Stijn
ac145a82fd api/types: NewHijackedResponse: fix typo in GoDoc
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-31 22:42:55 +02: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
66b5b8bfa8 api/swagger: fix x-nullable for SystemInfo.Containerd
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:33:56 +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
Sebastiaan van Stijn
9716e06845 Merge pull request #48240 from vvoland/imageservice-imageinspect
images: Extract ImageInspect from GetImage
2024-07-29 15:00:33 +02:00
Sebastiaan van Stijn
50c3d19179 Merge pull request #48242 from thaJeztah/buildkit_fix_grpc_control_api_sizes
api/server/router/grpc: NewRouter: set correct MaxRecvMsgSize, MaxSendMsgSize
2024-07-26 13:34:44 +02:00
Sebastiaan van Stijn
cdbfae1d3e api/server/router/grpc: NewRouter: set correct MaxRecvMsgSize, MaxSendMsgSize
[buildkit@29b4b1a537][1] applied changes to `buildkitd` to set the correct
defaults, which should be 16MB, but used the library defaults. Without that
change, builds using large Dockerfiles would fail with a `ResourceExhausted`
error;

    => [internal] load build definition from Dockerfile
     => => transferring dockerfile: 896.44kB
    ERROR: failed to receive status: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (44865299 vs. 16777216)

However those changes were applied to the `buildkitd` code, which is the
daemon when running BuildKit standalone (or in a container through the
`container` driver). When running a build with the BuildKit builder compiled
into the Docker Engine, that code is not used, so the BuildKit changes did
not fix the issue.

This patch applies the same changes as were made in [buildkit@29b4b1a537][1]
to the gRPC endpoint provided by the dockerd daemon.

[1]: 29b4b1a537

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-26 11:15:46 +02:00
Paweł Gronowski
cd11843df8 images: Extract ImageInspect from GetImage
Remove a special `Details` parameter from the `GetImage` options and
extract its behavior to a `ImageInspect` method as it was only used by
the `/images/{name}/json` endpoint (`docker image inspect`).

This makes it easier for the containerd image service to output an image
inspect output without having to use the same data structures as the
graphdrivers.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-07-25 20:13:41 +02:00
Sebastiaan van Stijn
ae96ce866f remove support for setting CORS headers (deprecated)
Configuring CORS headers was deprecated in docker 27.0 through
7ea9acc97f, which disabled them by default
with a temporary `DOCKERD_DEPRECATED_CORS_HEADER` env-var to allow using
the option.

This patch removes the feature altogether; the flag is kept for one more
release to allow printing a more informative error, but can be removed in
the next release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-22 21:29:44 +02:00
Sebastiaan van Stijn
f39409f80d Merge pull request #48078 from vvoland/c8d-buildkit-tag-event
c8d/build: Log `image tag` event when image was built with Buildkit
2024-07-18 21:46:49 +02: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
Akihiro Suda
1205a90733 Merge pull request #47142 from thaJeztah/migrate_to_platforms_module
vendor: github.com/containerd/containerd v1.7.19, migrate to github.com/containerd/platforms module
2024-07-04 10:59:16 +09:00
Sebastiaan van Stijn
fb18966aa5 api/types/container: InspectResponse: keep old name for embedded type
This is a follow-up to 1abc8f6158, which
moved the ContainerJSONBase to api/types/container, but also renamed it
to container.InspectBase. This field is embedded into the InspectResponse
type, which meant that renaming the type also implicitly renamed the
field when creating this type from a struct-literal.

While we're planning to merge these types (which would be a breaking
change for users constructing it through struct-literals), let's keep
it backward-compatible for now (other than deprecating the old names).

We can continue the other changes separately.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-03 17:14:03 +02:00
Paweł Gronowski
4d1d7c3ebe update to go1.21.12
- https://github.com/golang/go/issues?q=milestone%3AGo1.21.12+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.21.11...go1.21.12

These minor releases include 1 security fixes following the security policy:

net/http: denial of service due to improper 100-continue handling

The net/http HTTP/1.1 client mishandled the case where a server responds to a request with an "Expect: 100-continue" header with a non-informational (200 or higher) status. This mishandling could leave a client connection in an invalid state, where the next request sent on the connection will fail.

An attacker sending a request to a net/http/httputil.ReverseProxy proxy can exploit this mishandling to cause a denial of service by sending "Expect: 100-continue" requests which elicit a non-informational response from the backend. Each such request leaves the proxy with an invalid connection, and causes one subsequent request using that connection to fail.

Thanks to Geoff Franks for reporting this issue.

This is CVE-2024-24791 and Go issue https://go.dev/issue/67555.

View the release notes for more information:
https://go.dev/doc/devel/release#go1.21.12

**- Description for the changelog**

```markdown changelog
Update Go runtime to 1.21.12
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-07-03 10:28:59 +02:00
Sebastiaan van Stijn
d0aa3eaccf Migrate to github.com/containerd/platforms module
Switch to use github.com/containerd/platforms module, because containerd's
platforms package has moved to a separate module. This allows updating the
platforms parsing independent of the containerd module itself.

The package in containerd is deprecated, but kept as an alias to provide
compatibility between codebases.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 21:20:29 +02:00
Sebastiaan van Stijn
ef356c53ba api/types: remove deprecated ContainerNode, ContainerJSONBase.Node
It was moved and deprecated in 1fc9236119
(4587688258 for v27.0). This patch removes the
temporary alias and removes the relocated  api/types/container.ContainerNode
as well as the Node field on the api/types/container.Base struct.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:20:38 +02:00
Sebastiaan van Stijn
5b9ed8081b api/types: remove deprecated ImageLoadResponse
It moved to api/types/image.LoadResponse in 6c2934f373.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:56 +02:00
Sebastiaan van Stijn
d3defe9140 api/types: remove deprecated ImageImportSource
It moved to api/types/image.ImportSource in eb675cce71.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:55 +02:00
Sebastiaan van Stijn
6cdb123b6f api/types: remove deprecated ImageSearchOptions
It moved to api/types/registry.SearchOptions in f6cc76ceb9.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:55 +02:00
Sebastiaan van Stijn
67b7b15674 api/types: remove deprecated EventsOptions
It moved to api/types/events.ListOptions in b5f15bc0aa.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:55 +02:00
Sebastiaan van Stijn
3cbc166d2e api/types: remove deprecated container stats types
These types were moved to api/types/container in 0a4277abf4.

This removes the temporary aliases for:

- ThrottlingData
- CPUUsage
- CPUStats
- MemoryStats
- BlkioStatEntry
- BlkioStats
- StorageStats
- NetworkStats
- PidsStats
- Stats
- StatsJSON (moved/renamed to api/types/container.StatsResponse)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:55 +02:00
Sebastiaan van Stijn
ec5cede0a2 api/types: remove deprecated ContainerStats
It moved to api/types/container.StatsResponseReader in 17c3269a37.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:55 +02:00
Sebastiaan van Stijn
4ffe497ba4 api/types: remove deprecated CopyToContainerOptions
It moved to api/types/container.CopyToContainerOptions in fd1d8f323b.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:54 +02:00
Sebastiaan van Stijn
345e31ab96 api/types: remove deprecated ContainerPathStat
It moved to api/types/container.PathStat in 47d7c9e31d.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:54 +02:00
Sebastiaan van Stijn
2bceb34717 api/types: remove deprecated ContainersPruneReport
It moved to api/types/container.PruneReport in db2f1acd5d.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:54 +02:00
Sebastiaan van Stijn
0e64c9e93b api/types: remove deprecated ContainerExecInspect
It moved to api/types/container.ExecInspect in 5b27e71521.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:54 +02:00
Sebastiaan van Stijn
6f0caec226 api/types: remove deprecated ExecStartCheck
It's replaced by api/types/container.ExecStartOptions and ExecAttachOptions
in cd76e3e7f8. This patch removes the temporary
alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:54 +02:00
Sebastiaan van Stijn
13fbd394ee api/types: remove deprecated ExecConfig
It moved to api/types/container.ExecOptions in cd76e3e7f8.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:53 +02:00
Sebastiaan van Stijn
665eef54db api/types: remove deprecated NetworksPruneReport
It moved to api/types/network.PruneReport in e5f9484ab6.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:53 +02:00
Sebastiaan van Stijn
d2256faa0e api/types: remove deprecated NetworkResource
It's replaced by api/types/network.Inspect and api/types/network.Summary in
68bf0e7625. This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:53 +02:00
Sebastiaan van Stijn
ffdd2de674 api/types: remove deprecated EndpointResource
It moved to api/types/network.EndpointResource in 68bf0e7625.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:53 +02:00
Sebastiaan van Stijn
f0f2b8f7cb api/types: remove deprecated NetworkDisconnect
It moved to api/types/network.DisconnectOptions in 245d12175f.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:53 +02:00
Sebastiaan van Stijn
cf9d9ff50d api/types: remove deprecated NetworkConnect
It moved to api/types/network.ConnectOptions in 245d12175f.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:52 +02:00
Sebastiaan van Stijn
39c7b5f3e3 api/types: remove deprecated NetworkInspectOptions
It moved to api/types/network.InspectOptions in 5bea0c38bc.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:52 +02:00
Sebastiaan van Stijn
64583771f0 api/types: remove deprecated NetworkCreateResponse
It moved to api/types/network.CreateResponse in 89624e09e6.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:52 +02:00
Sebastiaan van Stijn
c99e0bc8ae api/types: remove deprecated NetworkListOptions
It moved to api/types/network.ListOptions in f78dac35e5.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:52 +02:00
Sebastiaan van Stijn
48f147e8d3 api/types: remove deprecated NetworkCreate
It moved to api/types/network.CreateOptions in 162ef4f8d1.
This patch removes the temporary alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-02 14:19:52 +02:00