Commit Graph

10188 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 40539963c2
opts: parseKeyValueFile: cleanup and remove redundant trimming
- the function already trimmed leading whitespace from each line before
  parsing. keys with trailing whitespace would be invalidated, and values
  have whitespace preserved, so there's no need to trim whitespace for the
  key.
- if a line is validated (key is valid), we don't need to reconstruct the
  key=value by concatenating, and we can add the line as-is.
- check if the key is empty before checking if it contains whitespace
- touch-up comments
- rename some variables for readability
- slight cleanup to use early returns / early continues to reduce nesting

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 76196dbb01)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-08 14:18:39 +00:00
Sebastiaan van Stijn 25224ab615
opts: remove ErrBadKey as it's not used as a sentinel error
This error was originally introduced `ErrBadEnvVariable` in [moby/moby@500c8ba],
but merely for convenience, and not used as a sentinel error. After the code
was moved from the daemon to the cli repository, it was renamed to be more
generic `ErrBadKey` in commit 2b17f4c8a8.

A search on GitHub shows that there's no consumers using this error as
sentinel error, and it's not used in our own code as such, so it should
be safe to remove this error.

This patch removes the `ErrBadKey` error-type; it also removes the prefix
(`poorly formatted environment:`) to make the error more generic, because
the same function was used both for env-files and label-files.

[moby/moby@500c8ba]: 500c8ba4b6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 95e221ef4d)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-08 14:18:14 +00:00
Djordje Lukic 4694fc8e45
Do not underline image name
Blue text with underline looks too much as a hyperlink I can click on

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
(cherry picked from commit 17040890e4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-08 16:00:38 +02:00
Brian Goff 352ee0acd4
Images Tree: Change 'Used' to 'In Use'
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit df52ddcfcc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-08 15:39:06 +02:00
Sebastiaan van Stijn d0cb93ab08
Merge pull request #5512 from austinvazquez/cherry-pick-a6ab65948e6ecaf4167e2ef91b24c30929296256-to-27.x
[27.x backport] ci: update to go1.22.8
2024-10-08 10:38:46 +02:00
Austin Vazquez 132ecbce8b
ci: update to go1.22.8
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
(cherry picked from commit a6ab65948e)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-08 03:54:21 +00:00
Sebastiaan van Stijn 011cb195f0
Merge pull request #5509 from austinvazquez/cherry-pick-2f2b16a96687e50682497435a6de3b016ab1a5bc-to-27.x
[27.x backport] docs: fix inaccurate description of --restart=unless-stopped
2024-10-07 19:29:48 +02:00
David Karlsson 6f5bfcb276
docs: fix inaccurate description of --restart=unless-stopped
`unless-stopped` containers are not restart after a daemon restart

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
(cherry picked from commit 2f2b16a966)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-07 16:37:35 +00:00
Sebastiaan van Stijn fa0bb9f4b4
Merge pull request #5470 from dvdksn/cp_5469
[27.x backport] use important callout for buildkit vs legacy builder
2024-10-04 13:06:17 +02:00
Sebastiaan van Stijn 4c5eb4c301
Merge pull request #5499 from austinvazquez/cherry-pick-b129660dd39f566c6cdc692467a99bb422001a98-to-27.x
[27.x backport] opts: cleanup ParseEnvFile tests
2024-10-04 13:03:16 +02:00
Sebastiaan van Stijn b00668d4bc
Merge pull request #5497 from austinvazquez/cherry-pick-6075303483f632f301e36c9dab3679949948df52-to-27.x
[27.x backport] docs/reference: stop, restart: add flag descriptions
2024-10-04 12:47:43 +02:00
Sebastiaan van Stijn e978602169
Merge pull request #5498 from austinvazquez/cherry-pick-54a20ce54caa3f24349eebd8f2cf6f47959c5556-to-27.x
[27.x backport] docs: fix a typo in run.md
2024-10-04 12:46:42 +02:00
Sebastiaan van Stijn 19279c9e53
opts: cleanup ParseEnvFile tests
- Use gotest.tools for assertions
- Check for expected error messages
- Don't check for ErrBadKey errors, as it's not used
  as a sentinel error anywhere.
- Use t.SetEnv() instead of depending on `HOME` being set
- Use t.TempDir() for writing temporary files

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b129660dd3)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-04 06:11:46 +00:00
David Karlsson d2aec10148
docs: fix a typo in run.md
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
(cherry picked from commit 54a20ce54c)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-04 06:07:07 +00:00
Sebastiaan van Stijn 6445ae2f02
docs/reference: stop, restart: add flag descriptions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6075303483)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-04 06:01:26 +00:00
Laura Brehm 5771be8156
Merge pull request #5472 from dvdksn/cp_5471
[27.x backport] fix anchor link to web-based login section
2024-09-23 14:16:53 +01:00
David Karlsson fbd51c01c6 docs: fix anchor link to web-based login section
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
(cherry picked from commit 465e87afc7)
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-09-23 13:53:48 +02:00
David Karlsson 23cea90233 docs: use important callout for buildkit vs legacy builder
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
(cherry picked from commit 8a3d838a19)
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-09-23 13:40:54 +02:00
Laura Brehm ce1223035a
Merge pull request #5462 from thaJeztah/27.x_backport_bump_compose
[27.x] Dockerfile: update compose to v2.29.7
2024-09-20 12:01:47 +01:00
Laura Brehm 263ba959c4
Merge pull request #5461 from laurazard/27.x-backport-update-VERSION 2024-09-20 11:48:12 +01:00
Laura Brehm be9b9f3d70
Update `VERSION` file to `v27.3.1-dev`
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
(cherry picked from commit 91c90a9797)
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-09-20 11:41:57 +01:00
Sebastiaan van Stijn a4149b0c3d
Dockerfile: update compose to v2.29.7
Update the compose cli plugin used in the dev-container

full diff: https://github.com/docker/compose/compare/v2.29.4...v2.29.7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ce26ebc0e9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-20 12:41:56 +02:00
Laura Brehm 4aac4154b0
Merge pull request #5458 from thaJeztah/27.x_bump_engine3
[27.x] vendor: github.com/docker/docker v27.3.0
2024-09-20 11:23:44 +01:00
Sebastiaan van Stijn 854695884a
vendor: github.com/docker/docker v27.3.0
no diff, just re-tagged; https://github.com/docker/docker/compare/v27.3.0-rc.2...v27.3.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-20 12:13:41 +02:00
Laura Brehm f05200311d
Merge pull request #5457 from laurazard/backport-dropped-defer
[27.x backport] telemetry: fix early meterprovider shutdown
2024-09-20 01:49:45 +01:00
Laura Brehm 460f1becc5
telemetry: fix early meterprovider shutdown
In 4b5a196fee, we changed the CLI global
meter provider shutdown in order to handle any error returned by the
metric export.

Unfortunately, we dropped a `defer` during the fix, which
causes the meter provider to be immediately shutdown after being created
and metrics to not be collected/exporter.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
(cherry picked from commit 1355d7e9f8)
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-09-20 01:37:00 +01:00
Sebastiaan van Stijn e85edf8556
Merge pull request #5452 from laurazard/27.3.0-match-moby-version
[27.x] vendor: github.com/docker/docker v27.3.0-rc2
2024-09-18 17:59:19 +02:00
Laura Brehm ca62759b0f
vendor: github.com/docker/docker v27.3.0-rc2
No vendor changes, just using tag.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-09-18 16:30:22 +01:00
Sebastiaan van Stijn e4dc9d2ac7
Merge pull request #5448 from laurazard/backport-otel-shutdown-errors
[27.x backport] telemetry: handle otel errors on shutdown
2024-09-18 12:20:40 +02:00
Sebastiaan van Stijn ddf8f23403
Merge pull request #5449 from laurazard/backport-lowercase-windows-drive
[27.x backport] command: change drive to lowercase for wsl path
2024-09-18 12:16:32 +02:00
Jonathan A. Sternberg c6dde25470
command: change drive to lowercase for wsl path
On Windows, the drive casing doesn't matter outside of WSL. For WSL, the
drives are lowercase. When we're producing a WSL path, lowercase the
drive letter.

Co-authored-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
Co-authored-by: Laura Brehm <laurabrehm@hey.com>

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
(cherry picked from commit 3472bbc28a)
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-09-18 11:05:51 +01:00
Laura Brehm fcf6dd05df
Merge pull request #5447 from thaJeztah/27.x_backport_codeql_updates
[27.x backport] gha: update codeql workflow to go1.22.7
2024-09-18 11:04:09 +01:00
Jonathan A. Sternberg 4b5a196fee
telemetry: pass otel errors to the otel handler for shutdown and force flush
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
(cherry picked from commit b1956f5073)
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-09-18 10:43:32 +01:00
Sebastiaan van Stijn e2eb069aed
gha: update codeql workflow to go1.22.7
commit d7d56599ca updated this
repository to go1.22, but the codeql action didn't specify a
patch version, and was missed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e1213edcc6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-17 21:58:05 +02:00
Laura Brehm 58a14cc379
Merge pull request #5443 from laurazard/backport-container-rm-docs
[27.x backport] docs: Fix --rm=false flag in container_run.md
2024-09-16 14:49:01 +01:00
Julio Cesar Garcia 81ca58bd20
docs: Fix --rm=false flag in container_run.md
Signed-off-by: Julio Cesar Garcia <juliogarciamelgarejo@gmail.com>
(cherry picked from commit 605c9bf160)
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-09-16 14:31:37 +01:00
Laura Brehm 6b5e4be0cb
Merge pull request #5442 from thaJeztah/27.x_backport_bump_buildx_compose
[27.x backport] Dockerfile: update buildx to v0.17.1, compose to v2.29.4
2024-09-16 14:27:43 +01:00
Sebastiaan van Stijn b5c6541769
Dockerfile: update compose to v2.29.4
Update the compose cli plugin used in the dev-container

full diff: https://github.com/docker/compose/compare/v2.29.0...v2.29.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f7a513cff0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-16 15:05:04 +02:00
Sebastiaan van Stijn 6fdd11b012
Dockerfile: update buildx to v0.17.1
Update the buildx cli plugin used in the dev-container

full diff: https://github.com/docker/buildx/compare/0.16.1...0.17.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 42ce06aa5b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-16 15:05:04 +02:00
Laura Brehm 6bf64a88af
Merge pull request #5440 from thaJeztah/27.x_vendor_moby
[27.x] vendor: github.com/docker/docker v27.3.0-rc.1
2024-09-16 13:41:37 +01:00
Sebastiaan van Stijn d896559894
vendor: github.com/docker/docker v27.3.0-rc.1
no diff, as it's the same commit, but tagged

full diff: https://github.com/docker/docker/compare/bf60e5cced83...v27.3.0-rc.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-16 14:28:09 +02:00
Sebastiaan van Stijn f350724e21
Merge pull request #5439 from thaJeztah/27.x_backport_docs_updates
[27.x backport] docs, man: dockerd: add documentation for "--log-format" and "--feature" options
2024-09-16 14:24:39 +02:00
Sebastiaan van Stijn 84d4a5ef11
docs: dockerd: add documentation for --log-format option
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit baceb4b158)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-16 13:55:17 +02:00
Sebastiaan van Stijn 7c72283b37
man: dockerd: add description for --log-format option
This option was added in a08abec9f8d59eaa44c375900e254384a68c5a31,
as part of Docker v25.0, but did not update the docs and manpage.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9ae514fdc7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-16 13:55:17 +02:00
Sebastiaan van Stijn 245f79ff57
docs/reference: dockerd: add docs for --feature option
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a42ca1148d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-16 13:55:03 +02:00
Sebastiaan van Stijn db7a014d37
man: dockerd: value is optional for --feature flag
The --feature flag allows the boolean value to be omitted.
If only a name is provided, the default is "true".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a357db0aba)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-16 13:55:03 +02:00
Sebastiaan van Stijn bc87ef962a
man: fix duplicate word in --feature flag description
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit fb056d2ceb)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-16 13:55:03 +02:00
Sebastiaan van Stijn 7811c442d6
man: update dockerd man-page to include --feature flag
commit f13c08246d93dd5aae200d5881a3a374e6cac876 introduced
this flag, but did not yet update the manpage.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 610f9157f5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-16 13:55:00 +02:00
Sebastiaan van Stijn 48a2cdff97
Merge pull request #5432 from thaJeztah/27.x_backport_wsl-socket-path
[27.x backport] command: check for wsl mount path on windows
2024-09-13 10:54:31 +02:00
Jonathan A. Sternberg b48720e65e
command: check for wsl mount path on windows
This checks for the equivalent WSL mount path on windows. WSL will mount
the windows drives at `/mnt/c` (or whichever drive is being used).

This is done by parsing a UNC path with forward slashes from the unix
socket URL.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
(cherry picked from commit 38c3fef1a8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-09-13 00:35:37 +02:00