From d04d0631ae033d66101ed541b286d091b50ea45a Mon Sep 17 00:00:00 2001 From: Austin Vazquez Date: Wed, 30 Oct 2024 18:17:54 -0700 Subject: [PATCH 1/4] docs: remove older warning format Signed-off-by: Austin Vazquez --- frontend/dockerfile/docs/reference.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/frontend/dockerfile/docs/reference.md b/frontend/dockerfile/docs/reference.md index de397f7956ba..e6ca41ba0c3d 100644 --- a/frontend/dockerfile/docs/reference.md +++ b/frontend/dockerfile/docs/reference.md @@ -943,7 +943,6 @@ The command is run in the host's network environment (similar to > which needs to be enabled when starting the buildkitd daemon with > `--allow-insecure-entitlement network.host` flag or in [buildkitd config](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md), > and for a build request with [`--allow network.host` flag](https://docs.docker.com/engine/reference/commandline/buildx_build/#allow). -{ .warning } ### RUN --security @@ -964,7 +963,6 @@ This is equivalent to running `docker run --privileged`. > enabled when starting the buildkitd daemon with > `--allow-insecure-entitlement security.insecure` flag or in [buildkitd config](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md), > and for a build request with [`--allow security.insecure` flag](https://docs.docker.com/engine/reference/commandline/buildx_build/#allow). -{ .warning } Default sandbox mode can be activated via `--security=sandbox`, but that is no-op. @@ -2255,7 +2253,6 @@ runtime, runs the relevant `ENTRYPOINT` and `CMD` commands. > > On Windows, the user must be created first if it's not a built-in account. > This can be done with the `net user` command called as part of a Dockerfile. -{ .warning } ```dockerfile FROM microsoft/windowsservercore @@ -2326,7 +2323,6 @@ flag. > > Refer to the [`RUN --mount=type=secret`](#run---mounttypesecret) section to > learn about secure ways to use secrets when building images. -{ .warning } A Dockerfile may include one or more `ARG` instructions. For example, the following is a valid Dockerfile: From aaccd15f8f3e9772951568057fbc93cd0d68c92b Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:24:47 +0100 Subject: [PATCH 2/4] Dockerfile: use folded block for rule description in docs front matter Prevously, descriptions containing a colon would result in broken yaml in the front matter of the generated docs. Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- frontend/dockerfile/linter/generate.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/dockerfile/linter/generate.go b/frontend/dockerfile/linter/generate.go index d5ca53dcf562..8068947092f4 100644 --- a/frontend/dockerfile/linter/generate.go +++ b/frontend/dockerfile/linter/generate.go @@ -30,7 +30,8 @@ type Rule struct { const tmplStr = `--- title: {{ .Rule.Name }} -description: {{ .Rule.Description }} +description: >- + {{ .Rule.Description }} {{- if .Rule.URLAlias }} aliases: - {{ .Rule.URLAlias }} From 66fec1da1bd0d9774f6a706461d189b124eefb9f Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:28:40 +0100 Subject: [PATCH 3/4] chore: regenerate dockerfile rules documentation Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- .../dockerfile/docs/rules/consistent-instruction-casing.md | 3 ++- frontend/dockerfile/docs/rules/copy-ignored-file.md | 3 ++- frontend/dockerfile/docs/rules/duplicate-stage-name.md | 3 ++- frontend/dockerfile/docs/rules/from-as-casing.md | 3 ++- .../docs/rules/from-platform-flag-const-disallowed.md | 3 ++- frontend/dockerfile/docs/rules/invalid-default-arg-in-from.md | 3 ++- .../dockerfile/docs/rules/invalid-definition-description.md | 3 ++- frontend/dockerfile/docs/rules/json-args-recommended.md | 3 ++- frontend/dockerfile/docs/rules/legacy-key-value-format.md | 3 ++- frontend/dockerfile/docs/rules/maintainer-deprecated.md | 3 ++- .../dockerfile/docs/rules/multiple-instructions-disallowed.md | 3 ++- frontend/dockerfile/docs/rules/no-empty-continuation.md | 3 ++- frontend/dockerfile/docs/rules/redundant-target-platform.md | 3 ++- frontend/dockerfile/docs/rules/reserved-stage-name.md | 3 ++- frontend/dockerfile/docs/rules/secrets-used-in-arg-or-env.md | 3 ++- frontend/dockerfile/docs/rules/stage-name-casing.md | 3 ++- frontend/dockerfile/docs/rules/undefined-arg-in-from.md | 3 ++- frontend/dockerfile/docs/rules/undefined-var.md | 3 ++- frontend/dockerfile/docs/rules/workdir-relative-path.md | 3 ++- 19 files changed, 38 insertions(+), 19 deletions(-) diff --git a/frontend/dockerfile/docs/rules/consistent-instruction-casing.md b/frontend/dockerfile/docs/rules/consistent-instruction-casing.md index b080490d4736..cef6e16c7a18 100644 --- a/frontend/dockerfile/docs/rules/consistent-instruction-casing.md +++ b/frontend/dockerfile/docs/rules/consistent-instruction-casing.md @@ -1,6 +1,7 @@ --- title: ConsistentInstructionCasing -description: All commands within the Dockerfile should use the same casing (either upper or lower) +description: >- + All commands within the Dockerfile should use the same casing (either upper or lower) aliases: - /go/dockerfile/rule/consistent-instruction-casing/ --- diff --git a/frontend/dockerfile/docs/rules/copy-ignored-file.md b/frontend/dockerfile/docs/rules/copy-ignored-file.md index fd16896131b3..3e8e57e8d4c5 100644 --- a/frontend/dockerfile/docs/rules/copy-ignored-file.md +++ b/frontend/dockerfile/docs/rules/copy-ignored-file.md @@ -1,6 +1,7 @@ --- title: CopyIgnoredFile -description: Attempting to Copy file that is excluded by .dockerignore +description: >- + Attempting to Copy file that is excluded by .dockerignore aliases: - /go/dockerfile/rule/copy-ignored-file/ --- diff --git a/frontend/dockerfile/docs/rules/duplicate-stage-name.md b/frontend/dockerfile/docs/rules/duplicate-stage-name.md index 67fe4da8c1f5..71cdfcaf91da 100644 --- a/frontend/dockerfile/docs/rules/duplicate-stage-name.md +++ b/frontend/dockerfile/docs/rules/duplicate-stage-name.md @@ -1,6 +1,7 @@ --- title: DuplicateStageName -description: Stage names should be unique +description: >- + Stage names should be unique aliases: - /go/dockerfile/rule/duplicate-stage-name/ --- diff --git a/frontend/dockerfile/docs/rules/from-as-casing.md b/frontend/dockerfile/docs/rules/from-as-casing.md index 5897f66fb233..03506c0ac80a 100644 --- a/frontend/dockerfile/docs/rules/from-as-casing.md +++ b/frontend/dockerfile/docs/rules/from-as-casing.md @@ -1,6 +1,7 @@ --- title: FromAsCasing -description: The 'as' keyword should match the case of the 'from' keyword +description: >- + The 'as' keyword should match the case of the 'from' keyword aliases: - /go/dockerfile/rule/from-as-casing/ --- diff --git a/frontend/dockerfile/docs/rules/from-platform-flag-const-disallowed.md b/frontend/dockerfile/docs/rules/from-platform-flag-const-disallowed.md index 9e4f7878871a..8a89ba275184 100644 --- a/frontend/dockerfile/docs/rules/from-platform-flag-const-disallowed.md +++ b/frontend/dockerfile/docs/rules/from-platform-flag-const-disallowed.md @@ -1,6 +1,7 @@ --- title: FromPlatformFlagConstDisallowed -description: FROM --platform flag should not use a constant value +description: >- + FROM --platform flag should not use a constant value aliases: - /go/dockerfile/rule/from-platform-flag-const-disallowed/ --- diff --git a/frontend/dockerfile/docs/rules/invalid-default-arg-in-from.md b/frontend/dockerfile/docs/rules/invalid-default-arg-in-from.md index 2e6ff309d3d6..aedce495ab79 100644 --- a/frontend/dockerfile/docs/rules/invalid-default-arg-in-from.md +++ b/frontend/dockerfile/docs/rules/invalid-default-arg-in-from.md @@ -1,6 +1,7 @@ --- title: InvalidDefaultArgInFrom -description: Default value for global ARG results in an empty or invalid base image name +description: >- + Default value for global ARG results in an empty or invalid base image name aliases: - /go/dockerfile/rule/invalid-default-arg-in-from/ --- diff --git a/frontend/dockerfile/docs/rules/invalid-definition-description.md b/frontend/dockerfile/docs/rules/invalid-definition-description.md index 23d353c03c6f..31ca1f7bc726 100644 --- a/frontend/dockerfile/docs/rules/invalid-definition-description.md +++ b/frontend/dockerfile/docs/rules/invalid-definition-description.md @@ -1,6 +1,7 @@ --- title: InvalidDefinitionDescription -description: Comment for build stage or argument should follow the format: `# `. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment. +description: >- + Comment for build stage or argument should follow the format: `# `. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment. aliases: - /go/dockerfile/rule/invalid-definition-description/ --- diff --git a/frontend/dockerfile/docs/rules/json-args-recommended.md b/frontend/dockerfile/docs/rules/json-args-recommended.md index e832233025ac..0fa7b01def10 100644 --- a/frontend/dockerfile/docs/rules/json-args-recommended.md +++ b/frontend/dockerfile/docs/rules/json-args-recommended.md @@ -1,6 +1,7 @@ --- title: JSONArgsRecommended -description: JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals +description: >- + JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals aliases: - /go/dockerfile/rule/json-args-recommended/ --- diff --git a/frontend/dockerfile/docs/rules/legacy-key-value-format.md b/frontend/dockerfile/docs/rules/legacy-key-value-format.md index 3008e3fb4878..dc43b53cb736 100644 --- a/frontend/dockerfile/docs/rules/legacy-key-value-format.md +++ b/frontend/dockerfile/docs/rules/legacy-key-value-format.md @@ -1,6 +1,7 @@ --- title: LegacyKeyValueFormat -description: Legacy key/value format with whitespace separator should not be used +description: >- + Legacy key/value format with whitespace separator should not be used aliases: - /go/dockerfile/rule/legacy-key-value-format/ --- diff --git a/frontend/dockerfile/docs/rules/maintainer-deprecated.md b/frontend/dockerfile/docs/rules/maintainer-deprecated.md index c777a17d345c..95c1f18dffa5 100644 --- a/frontend/dockerfile/docs/rules/maintainer-deprecated.md +++ b/frontend/dockerfile/docs/rules/maintainer-deprecated.md @@ -1,6 +1,7 @@ --- title: MaintainerDeprecated -description: The MAINTAINER instruction is deprecated, use a label instead to define an image author +description: >- + The MAINTAINER instruction is deprecated, use a label instead to define an image author aliases: - /go/dockerfile/rule/maintainer-deprecated/ --- diff --git a/frontend/dockerfile/docs/rules/multiple-instructions-disallowed.md b/frontend/dockerfile/docs/rules/multiple-instructions-disallowed.md index 6f8313f55e6c..09267bfd2208 100644 --- a/frontend/dockerfile/docs/rules/multiple-instructions-disallowed.md +++ b/frontend/dockerfile/docs/rules/multiple-instructions-disallowed.md @@ -1,6 +1,7 @@ --- title: MultipleInstructionsDisallowed -description: Multiple instructions of the same type should not be used in the same stage +description: >- + Multiple instructions of the same type should not be used in the same stage aliases: - /go/dockerfile/rule/multiple-instructions-disallowed/ --- diff --git a/frontend/dockerfile/docs/rules/no-empty-continuation.md b/frontend/dockerfile/docs/rules/no-empty-continuation.md index 4636eabf5d7f..8437859e4560 100644 --- a/frontend/dockerfile/docs/rules/no-empty-continuation.md +++ b/frontend/dockerfile/docs/rules/no-empty-continuation.md @@ -1,6 +1,7 @@ --- title: NoEmptyContinuation -description: Empty continuation lines will become errors in a future release +description: >- + Empty continuation lines will become errors in a future release aliases: - /go/dockerfile/rule/no-empty-continuation/ --- diff --git a/frontend/dockerfile/docs/rules/redundant-target-platform.md b/frontend/dockerfile/docs/rules/redundant-target-platform.md index 84bdfae060f5..f6192bb3b443 100644 --- a/frontend/dockerfile/docs/rules/redundant-target-platform.md +++ b/frontend/dockerfile/docs/rules/redundant-target-platform.md @@ -1,6 +1,7 @@ --- title: RedundantTargetPlatform -description: Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior +description: >- + Setting platform to predefined $TARGETPLATFORM in FROM is redundant as this is the default behavior aliases: - /go/dockerfile/rule/redundant-target-platform/ --- diff --git a/frontend/dockerfile/docs/rules/reserved-stage-name.md b/frontend/dockerfile/docs/rules/reserved-stage-name.md index bde3509be834..7f2a550d3517 100644 --- a/frontend/dockerfile/docs/rules/reserved-stage-name.md +++ b/frontend/dockerfile/docs/rules/reserved-stage-name.md @@ -1,6 +1,7 @@ --- title: ReservedStageName -description: Reserved words should not be used as stage names +description: >- + Reserved words should not be used as stage names aliases: - /go/dockerfile/rule/reserved-stage-name/ --- diff --git a/frontend/dockerfile/docs/rules/secrets-used-in-arg-or-env.md b/frontend/dockerfile/docs/rules/secrets-used-in-arg-or-env.md index 4bee96fbdd7f..db9d1caae671 100644 --- a/frontend/dockerfile/docs/rules/secrets-used-in-arg-or-env.md +++ b/frontend/dockerfile/docs/rules/secrets-used-in-arg-or-env.md @@ -1,6 +1,7 @@ --- title: SecretsUsedInArgOrEnv -description: Sensitive data should not be used in the ARG or ENV commands +description: >- + Sensitive data should not be used in the ARG or ENV commands aliases: - /go/dockerfile/rule/secrets-used-in-arg-or-env/ --- diff --git a/frontend/dockerfile/docs/rules/stage-name-casing.md b/frontend/dockerfile/docs/rules/stage-name-casing.md index 6aa82144725d..1324350a2e3d 100644 --- a/frontend/dockerfile/docs/rules/stage-name-casing.md +++ b/frontend/dockerfile/docs/rules/stage-name-casing.md @@ -1,6 +1,7 @@ --- title: StageNameCasing -description: Stage names should be lowercase +description: >- + Stage names should be lowercase aliases: - /go/dockerfile/rule/stage-name-casing/ --- diff --git a/frontend/dockerfile/docs/rules/undefined-arg-in-from.md b/frontend/dockerfile/docs/rules/undefined-arg-in-from.md index c07b60115b3d..3ec4632d2d11 100644 --- a/frontend/dockerfile/docs/rules/undefined-arg-in-from.md +++ b/frontend/dockerfile/docs/rules/undefined-arg-in-from.md @@ -1,6 +1,7 @@ --- title: UndefinedArgInFrom -description: FROM command must use declared ARGs +description: >- + FROM command must use declared ARGs aliases: - /go/dockerfile/rule/undefined-arg-in-from/ --- diff --git a/frontend/dockerfile/docs/rules/undefined-var.md b/frontend/dockerfile/docs/rules/undefined-var.md index b68820764508..f44ae6960a20 100644 --- a/frontend/dockerfile/docs/rules/undefined-var.md +++ b/frontend/dockerfile/docs/rules/undefined-var.md @@ -1,6 +1,7 @@ --- title: UndefinedVar -description: Variables should be defined before their use +description: >- + Variables should be defined before their use aliases: - /go/dockerfile/rule/undefined-var/ --- diff --git a/frontend/dockerfile/docs/rules/workdir-relative-path.md b/frontend/dockerfile/docs/rules/workdir-relative-path.md index 2e165323e4fe..06043ea15a09 100644 --- a/frontend/dockerfile/docs/rules/workdir-relative-path.md +++ b/frontend/dockerfile/docs/rules/workdir-relative-path.md @@ -1,6 +1,7 @@ --- title: WorkdirRelativePath -description: Relative workdir without an absolute workdir declared within the build can have unexpected results if the base image changes +description: >- + Relative workdir without an absolute workdir declared within the build can have unexpected results if the base image changes aliases: - /go/dockerfile/rule/workdir-relative-path/ --- From 819d7bc1b1a2c7885fe742d6d2dbf343fe863af7 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:34:27 +0100 Subject: [PATCH 4/4] docs: fix double parens in internal link Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- frontend/dockerfile/docs/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/dockerfile/docs/reference.md b/frontend/dockerfile/docs/reference.md index 54bee270fefe..507751da256b 100644 --- a/frontend/dockerfile/docs/reference.md +++ b/frontend/dockerfile/docs/reference.md @@ -347,7 +347,7 @@ despite warnings. To make the build fail on warnings, set `#check=error=true`. > [!NOTE] > When using the `check` directive, with `error=true` option, it is recommended -> to pin the [Dockerfile syntax]((#syntax)) to a specific version. Otherwise, your build may +> to pin the [Dockerfile syntax](#syntax) to a specific version. Otherwise, your build may > start to fail when new checks are added in the future versions. To combine both the `skip` and `error` options, use a semi-colon to separate