Skip to content

Commit

Permalink
Merge pull request #437 from bcressey/buildkit-build-checks
Browse files Browse the repository at this point in the history
fix syntax warnings from newer versions of Docker
  • Loading branch information
cbgbt authored Jan 13, 2025
2 parents b0347e6 + be2328c commit 2899c62
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
9 changes: 9 additions & 0 deletions tools/buildsys/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,15 @@ impl DockerBuild {
args.build_arg("NOCACHE", &self.common_build_args.nocache);
args.build_arg("TOKEN", &self.common_build_args.token);
args.build_arg("OUTPUT_SOCKET", &self.common_build_args.output_socket);

// Skip some build checks:
// - InvalidDefaultArgInFrom warns about the SDK argument, which is always set
// - SecretsUsedInArgOrEnv warns about the TOKEN argument, which is not a secret
args.build_arg(
"BUILDKIT_DOCKERFILE_CHECK",
"skip=InvalidDefaultArgInFrom,SecretsUsedInArgOrEnv",
);

args
}
}
Expand Down
12 changes: 6 additions & 6 deletions twoliter/embedded/build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG SDK
ARG ARCH
ARG GOARCH

FROM ${SDK} as sdk
FROM ${SDK} AS sdk

############################################################################################
# Section 1: The following build stages are used to build rpm.spec packages
Expand Down Expand Up @@ -194,7 +194,7 @@ COPY --from=kitbuild /tmp/.${NOCACHE} /

# =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^=
# Generate the expected RPM macros and bconds.
FROM sdk as rpm-macros-and-bconds
FROM sdk AS rpm-macros-and-bconds
ARG VARIANT
ARG VARIANT_PLATFORM
ARG VARIANT_RUNTIME
Expand Down Expand Up @@ -314,7 +314,7 @@ RUN --mount=target=/host \

# =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^=
# Builds a Bottlerocket image.
FROM repobuild as imgbuild
FROM repobuild AS imgbuild
ARG ARCH
ARG VERSION_ID
ARG BUILD_ID
Expand Down Expand Up @@ -385,7 +385,7 @@ RUN --mount=target=/host \

# =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^=
# Creates an archive of the datastore migrations.
FROM repobuild as migrationbuild
FROM repobuild AS migrationbuild
ARG ARCH
ARG VERSION_ID
ARG BUILD_ID
Expand Down Expand Up @@ -417,7 +417,7 @@ RUN --mount=target=/host \

# =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^=
# Creates an archive of kernel development sources and toolchain.
FROM repobuild as kmodkitbuild
FROM repobuild AS kmodkitbuild
# The list of packages from the variant Cargo.toml package.metadata.build-variant.packages section.
ARG PACKAGES
ARG ARCH
Expand Down Expand Up @@ -461,7 +461,7 @@ COPY --from=kmodkitbuild /tmp/.${NOCACHE} /output/

# =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^=
# Repack an existing image.
FROM sdk as imgrepack
FROM sdk AS imgrepack
ARG ARCH
ARG VERSION_ID
ARG BUILD_ID
Expand Down

0 comments on commit 2899c62

Please sign in to comment.