Commit Graph

8681 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 2c1fde2239
fix docker info --format=json not outputting json format
The --format=json option was added for all inspect commands, but was not implemented
for "docker info". This patch implements the missing option.

Before this patch:

    docker info --format=json
    json

With this patch applied:

    docker info --format=json
    {"ID":"80c2f18a-2c88-4e4a-ba69-dca0eea59835","Containers":7,"ContainersRunning":"..."}

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 46234b82e2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-26 12:12:25 +02:00
Sebastiaan van Stijn 99124087e0
cli/command/formatter: export JSONFormat const
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1aaa179d9d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-26 12:12:24 +02:00
Sebastiaan van Stijn 86e79b55ed
volumes: prune: add --all / -a option
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0dec5d20a2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-26 12:06:39 +02:00
Sebastiaan van Stijn ada43812d0
cli/command/volume: suppress err output in tests
These tests were deliberately producing errors as part of the test, but
printing those errors could be confusing / make it more difficult to find
actual test-failures.

Before this patch:

    === RUN   TestVolumeCreateErrors
    Error: conflicting options: either specify --name or provide positional arg, not both
    Error: "create" requires at most 1 argument.
    See 'create --help'.

    Usage:  create [OPTIONS] [VOLUME] [flags]

    Create a volume
    Error: error creating volume
    --- PASS: TestVolumeCreateErrors (0.00s)
    PASS

With this patch applied:

    === RUN   TestVolumeCreateErrors
    --- PASS: TestVolumeCreateErrors (0.00s)
    PASS

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit db827d583b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-26 12:06:33 +02:00
Sebastiaan van Stijn ced769fc12
Merge pull request #4217 from vvoland/buildkit-empty-23
[23.0 backport] Handle empty DOCKER_BUILDKIT like unset
2023-04-20 09:01:14 +02:00
Paweł Gronowski c648e0b065
Handle empty DOCKER_BUILDKIT like unset
This fixes the cli erroring out if the variable is set to an empty
value.

```
$ export DOCKER_BUILDKIT=
$ docker version
DOCKER_BUILDKIT environment variable expects boolean value: strconv.ParseBool: parsing "": invalid syntax
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit ff7f76af7a)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-04-19 15:53:40 +02:00
Sebastiaan van Stijn f480fb1e37
Merge pull request #4202 from thaJeztah/23.0_backport_docs_daemon_proxy_config
[23.0 backport] docs/reference: update dockerd docs for changes in 23.0
2023-04-13 21:58:12 +02:00
Sebastiaan van Stijn ad7ae5a894
Merge pull request #4196 from thaJeztah/23.0_backport_registry_fix_ResolveAuthConfig_docs
[23.0 backport] cli/command: fix documentation for ResolveAuthConfig
2023-04-13 14:20:31 +02:00
Sebastiaan van Stijn b6cd3c85b5
docs: update dockerd usage output for new proxy-options
Adds documentation for the options that were added in
427c7cc5f8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c846428cb6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 13:59:39 +02:00
Sebastiaan van Stijn aa85421ff8
docs/reference: dockerd: remove default oom-score-adjust
The daemon no longer adjusts its oom-score by default; see

- 2b8e68ef06
- cf7a5be0f2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c730a8eb95)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 13:59:39 +02:00
Sebastiaan van Stijn 6bc4bf4f05
docs/reference: dockerd: update seccomp flag description
Update the description for the changes made in;
68e96f88ee

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c209743612)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 13:59:38 +02:00
Sebastiaan van Stijn 8a35f92fff
docs/reference: dockerd: use table for env-vars
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 32bc912008)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 13:59:38 +02:00
Sebastiaan van Stijn 2cb152c41d
docs/reference: use table for proxy env-vars
Adding a description based on the Go documentation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3701748000)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 13:59:38 +02:00
Sebastiaan van Stijn 623da1997e
docs/reference: reformat env-vars table, and simplify
No need to mention that the env-var may be removed at that point to keep
the description more to-the-point.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 879e0804a4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 13:59:38 +02:00
Sebastiaan van Stijn e76242fff2
docs/reference: remove mention of DOCKER_NOWARN_KERNEL_VERSION
Support for this environment variable was removed in docker 23.0 in
1240f8b41d

From that patch:

> All regular, non-EOL Linux distros now come with more recent kernels
> out of the box. There may still be users trying to run on kernel 3.10
> or older (some embedded systems, e.g.), but those should be a rare
> exception, which we don't have to take into account.
>
> This patch removes the kernel version check on Linux, and the corresponding
> DOCKER_NOWARN_KERNEL_VERSION environment that was there to skip this
> check.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 4a863df57a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-13 13:59:38 +02:00
Sebastiaan van Stijn 0b3f54066c
Merge pull request #4195 from thaJeztah/23.0_backport_fix_deprecation_version
[23.0 backport] docs: deprecated: fix version (23.1.0 -> 24.0.0)
2023-04-12 12:42:21 +02:00
Sebastiaan van Stijn 4b4d7e2b48
cli/command: fix documentation for ResolveAuthConfig
This function no longer uses the /info endpoint to resolve the registry
to use. The documentation for this function was still referring to
the (once used) special registry for Windows images, which is no longer
in use, so update the docs to reflect reality :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5bd359132b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-12 12:39:06 +02:00
Sebastiaan van Stijn e67e5559d5
docs: deprecated: fix version (23.1.0 -> 24.0.0)
The next release will be "v24.0.0", not "v23.1.0"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 04df700257)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-12 12:12:46 +02:00
Sebastiaan van Stijn 8b783cc22a
Merge pull request #4172 from thaJeztah/23.0_backport_fix_mddocs
[23.0 backport] scripts/docs/generate-md.sh: fix location of generate code
2023-04-11 18:11:30 +02:00
Sebastiaan van Stijn 9d4a21cd79
Merge pull request #4175 from thaJeztah/23.0_backport_ci_split_build
[23.0 backport] ci: enhanced build workflow
2023-04-11 18:11:13 +02:00
Sebastiaan van Stijn d45284a65d
Merge pull request #4176 from thaJeztah/23.0_backport_fix_docs_grammar
[23.0 backport] Fix grammar in docs by adding omitted word
2023-04-11 18:10:53 +02:00
Sebastiaan van Stijn fe7eb06263
Merge pull request #4182 from thaJeztah/23.0_backport_no_2206
[23.0 backport] docs: update engine versions in some examples
2023-04-11 18:10:15 +02:00
Sebastiaan van Stijn 7192601845
Merge pull request #4178 from thaJeztah/23.0_engine_23.0.3
[23.0] vendor: github.com/docker/docker v23.0.3
2023-04-11 18:09:56 +02:00
Sebastiaan van Stijn 726dfe92ec
Merge pull request #4177 from thaJeztah/23.0_backport_fix_bash_file_completion
[23.0 backport] Fix plugin completion parsing for plugins using `ShellCompDirectiveFilterFileExt`
2023-04-11 09:29:11 +02:00
Sebastiaan van Stijn a8e3b4b852
docs: update engine versions in some examples
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5d33b72769)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 16:51:44 +02:00
Sebastiaan van Stijn f88c159c7a
[23.0] vendor: github.com/docker/docker v23.0.3
full diff: https://github.com/docker/docker/compare/v23.0.2...v23.0.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 00:15:57 +02:00
Sebastiaan van Stijn 6c052fcda3
vendor: github.com/docker/docker v23.0.2
- migrate away from things deprecated in Go 1.20 (removes use of archive/tar.TypeRegA)

full diff: https://github.com/docker/docker/compare/v23.0.1...v23.0.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a39958846d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 00:13:48 +02:00
Sebastiaan van Stijn 079e80889d
vendor: golang.org/x/net v0.7.0
full diff: https://github.com/golang/net/compare/v0.5.0...v0.7.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d213548bd0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 00:11:54 +02:00
Sebastiaan van Stijn ff448ff455
vendor: golang.org/x/term v0.5.0
full diff: https://github.com/golang/term/compare/v0.4.0...v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3a0d492d1c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 00:11:44 +02:00
Sebastiaan van Stijn 476933b68b
vendor: golang.org/x/time v0.3.0
full diff: https://github.com/golang/time/compare/v0.1.0...v0.3.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f40bbf4f7f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 00:11:32 +02:00
Sebastiaan van Stijn 6131fe9e45
vendor: golang.org/x/text v0.7.0
full diff: https://github.com/golang/text/compare/v0.6.0...v0.7.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a85537d346)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 00:10:13 +02:00
Sebastiaan van Stijn bbc791ed7d
vendor: golang.org/x/sys v0.5.0
full diff: https://github.com/golang/sys/compare/v0.4.0...v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3e9c6e84ce)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 00:09:44 +02:00
Sebastiaan van Stijn dd6f77bbaa
vendor: github.com/moby/swarmkit/v2 v2.0.0-20230309194213-a745a8755ce3
full diff: 904c221ac2...a745a8755c

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ca8783ef43)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 00:05:28 +02:00
Sebastiaan van Stijn cb338ec972
vendor: github.com/containerd/containerd v1.6.19
full diff: https://github.com/containerd/containerd/compare/v1.6.16...v1.6.19

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 33806760a4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 00:04:54 +02:00
Sebastiaan van Stijn ffafb38e30
vendor: github.com/docker/docker v23.0.1
full diff: https://github.com/docker/docker/compare/v23.0.0...v23.0.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 71e495aa54)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 00:04:45 +02:00
Laura Brehm a763e51147
Fix plugin completion parsing for plugins using `ShellCompDirectiveFilterFileExt`
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
(cherry picked from commit 683e4bf0c4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-09 23:56:30 +02:00
Jake Stokes 3c7de64541
Fix grammar in docs by adding omitted word
Edited second paragraph under ### Daemon configuration file to change "regardless their value" to "regardless of their value"

Signed-off-by: Jake Stokes <contactjake@developerjake.com>
(cherry picked from commit 9335690a66)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-09 23:54:00 +02:00
CrazyMax 3d0d576af7
ci: enhanced build workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit bebdb6fa2a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-09 23:51:34 +02:00
Sebastiaan van Stijn 2609bd23ff
docs: regenerate markdown docs
This adds the new aliases that were added in 9b54d860cd

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 08a794dc0c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-09 23:00:16 +02:00
Sebastiaan van Stijn 5fd2c08502
scripts/docs/generate-md.sh: fix location of generate code
Commit 1e3622c50c moved the generator code
to a subdirectory, but forgot to update the markdown version of this script.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 37f234fbe7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-09 23:00:14 +02:00
Sebastiaan van Stijn 24d608d5f1
Merge pull request #4164 from thaJeztah/23.0_bump_go1.19.8
[23.0] update go to go1.19.8
2023-04-06 12:55:03 +02:00
Sebastiaan van Stijn 06ab5992dc
Merge pull request #4154 from thaJeztah/23.0_backport_fix_deprecation_message
[23.0 backport] cli/command: fix deprecation comments for Stream types
2023-04-05 17:01:59 +02:00
Sebastiaan van Stijn 5cd7710a04
update go to go1.19.8
go1.19.8 (released 2023-04-04) includes security fixes to the go/parser,
html/template, mime/multipart, net/http, and net/textproto packages, as well as
bug fixes to the linker, the runtime, and the time package. See the Go 1.19.8
milestone on our issue tracker for details:

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

full diff: https://github.com/golang/go/compare/go1.19.7...go1.19.8

Further details from the announcement on the mailing list:

We have just released Go versions 1.20.3 and 1.19.8, minor point releases.
These minor releases include 4 security fixes following the security policy:

- go/parser: infinite loop in parsing

  Calling any of the Parse functions on Go source code which contains `//line`
  directives with very large line numbers can cause an infinite loop due to
  integer overflow.
  Thanks to Philippe Antoine (Catena cyber) for reporting this issue.
  This is CVE-2023-24537 and Go issue https://go.dev/issue/59180.

- html/template: backticks not treated as string delimiters

  Templates did not properly consider backticks (`) as Javascript string
  delimiters, and as such did not escape them as expected. Backticks are
  used, since ES6, for JS template literals. If a template contained a Go
  template action within a Javascript template literal, the contents of the
  action could be used to terminate the literal, injecting arbitrary Javascript
  code into the Go template.

  As ES6 template literals are rather complex, and themselves can do string
  interpolation, we've decided to simply disallow Go template actions from being
  used inside of them (e.g. "var a = {{.}}"), since there is no obviously safe
  way to allow this behavior. This takes the same approach as
  github.com/google/safehtml. Template.Parse will now return an Error when it
  encounters templates like this, with a currently unexported ErrorCode with a
  value of 12. This ErrorCode will be exported in the next major release.

  Users who rely on this behavior can re-enable it using the GODEBUG flag
  jstmpllitinterp=1, with the caveat that backticks will now be escaped. This
  should be used with caution.

  Thanks to Sohom Datta, Manipal Institute of Technology, for reporting this issue.

  This is CVE-2023-24538 and Go issue https://go.dev/issue/59234.

- net/http, net/textproto: denial of service from excessive memory allocation

  HTTP and MIME header parsing could allocate large amounts of memory, even when
  parsing small inputs.

  Certain unusual patterns of input data could cause the common function used to
  parse HTTP and MIME headers to allocate substantially more memory than
  required to hold the parsed headers. An attacker can exploit this behavior to
  cause an HTTP server to allocate large amounts of memory from a small request,
  potentially leading to memory exhaustion and a denial of service.
  Header parsing now correctly allocates only the memory required to hold parsed
  headers.

  Thanks to Jakob Ackermann (@das7pad) for discovering this issue.

  This is CVE-2023-24534 and Go issue https://go.dev/issue/58975.

- net/http, net/textproto, mime/multipart: denial of service from excessive resource consumption

  Multipart form parsing can consume large amounts of CPU and memory when
  processing form inputs containing very large numbers of parts. This stems from
  several causes:

  mime/multipart.Reader.ReadForm limits the total memory a parsed multipart form
  can consume. ReadForm could undercount the amount of memory consumed, leading
  it to accept larger inputs than intended. Limiting total memory does not
  account for increased pressure on the garbage collector from large numbers of
  small allocations in forms with many parts. ReadForm could allocate a large
  number of short-lived buffers, further increasing pressure on the garbage
  collector. The combination of these factors can permit an attacker to cause an
  program that parses multipart forms to consume large amounts of CPU and
  memory, potentially resulting in a denial of service. This affects programs
  that use mime/multipart.Reader.ReadForm, as well as form parsing in the
  net/http package with the Request methods FormFile, FormValue,
  ParseMultipartForm, and PostFormValue.

  ReadForm now does a better job of estimating the memory consumption of parsed
  forms, and performs many fewer short-lived allocations.

  In addition, mime/multipart.Reader now imposes the following limits on the
  size of parsed forms:

  Forms parsed with ReadForm may contain no more than 1000 parts. This limit may
  be adjusted with the environment variable GODEBUG=multipartmaxparts=. Form
  parts parsed with NextPart and NextRawPart may contain no more than 10,000
  header fields. In addition, forms parsed with ReadForm may contain no more
  than 10,000 header fields across all parts. This limit may be adjusted with
  the environment variable GODEBUG=multipartmaxheaders=.

  Thanks to Jakob Ackermann for discovering this issue.

  This is CVE-2023-24536 and Go issue https://go.dev/issue/59153.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-05 15:49:47 +02:00
Sebastiaan van Stijn 683b099613
Merge pull request #4157 from cpuguy83/23.0_improve_cp_progress
[23.0 backport] improve cp progress
2023-04-05 02:33:53 +02:00
Sebastiaan van Stijn 391b2f0fab
Merge pull request #4141 from crazy-max/23.0_backport_fix-perf-reg
[23.0 backport] improve and load plugin command stubs when required
2023-04-05 02:33:19 +02:00
Brian Goff 209e9c0c13 cp: Do not block transfer on writing to terminal
This moves all the terminal writing to a goroutine that updates the
terminal periodically.
In our MITM copier we just use an atomic to add to the total number of
bytes read/written, the goroutine reads the total and updates the
terminal as needed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit eb392ff4ce)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-04-03 22:31:41 +00:00
Brian Goff ce68ce7ae8 cp: Make gocyclo happy
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit b9a1b0928a)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-04-03 22:31:34 +00:00
Brian Goff c28cb35c42 cp: Reduce number of progress updates
Only show progress updates after a time threshold has elapsed in order
to reduce the number of writes to the terminal.
This improves readability of the progress.

Also moves cursor show/hide into the progress printer to reduce chances
if messing up the user's terminal in case of cancellation.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 90b7bc36d4)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-04-03 22:31:23 +00:00
Brian Goff 948dfa91c9 cp: reduce branching in progress printer
This just makes it easier to reason about what is happening.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit efd011b793)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-04-03 22:31:13 +00:00
Brian Goff f813c9639f cp: Improve tty flashing on progress updates
- Instead of rewriting the entire line every time only clear and write
the parts that changed.
- Hide the cursor while writing progress

Both these things make the progress updates significantly easier to
read.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit ccae6e9299)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-04-03 22:31:06 +00:00