You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an environment variable and CLI flag to force the use of the C
Preprocessor (cpp) instead of only relying on the Containerfile suffix.
Closes#6744
Signed-off-by: James Harmison <jharmison@gmail.com>
Copy file name to clipboardExpand all lines: docs/buildah-build.1.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ The build context directory can be specified as the http(s) URL of an archive, g
18
18
19
19
If no context directory is specified, then Buildah will assume the current working directory as build context, which should contain a Containerfile.
20
20
21
-
Containerfiles ending with a ".in" suffix will be preprocessed via cpp(1). This can be useful to decompose Containerfiles into several reusable parts that can be used via CPP's **#include** directive. Notice, a Containerfile.in file can still be used by other tools when manually preprocessing them via `cpp -E`. Any comments ( Lines beginning with `#` ) in included Containerfile(s) that are not preprocess commands, will be printed as warnings during builds.
21
+
Containerfiles ending with a ".in" suffix will be automatically preprocessed via cpp(1). This can be useful to decompose Containerfiles into several reusable parts that can be used via CPP's **#include** directive. Notice, a Containerfile.in file can still be used by other tools when manually preprocessing them via `cpp -E`. Any comments ( Lines beginning with `#` ) in included Containerfile(s) that are not preprocess commands, will be printed as warnings during builds.
22
22
23
23
When the URL is an archive, the contents of the URL is downloaded to a temporary location and extracted before execution.
24
24
@@ -829,6 +829,13 @@ The `buildah build` command allows building images for all Linux architectures,
829
829
830
830
**NOTE:** The `--platform` option may not be used in combination with the `--arch`, `--os`, or `--variant` options.
831
831
832
+
**--preprocess**
833
+
834
+
If specified, will always attempt to use the C Preprocessor cpp(1),
835
+
even if the Containerfile doesn't end with the ".in" suffix.
836
+
Note: You can also configure this behavior by setting the BUILDAH\_PREPROCESS
837
+
environment variable to `1`, `true`, or `yes`.
838
+
832
839
**--pull**
833
840
834
841
Pull image policy. If not specified, the default is **missing**. If an explicit
fs.BoolVar(&flags.InheritLabels, "inherit-labels", true, "inherit the labels from the base image or base stages.")
251
252
fs.BoolVar(&flags.InheritAnnotations, "inherit-annotations", true, "inherit the annotations from the base image or base stages.")
252
253
fs.StringArrayVar(&flags.CPPFlags, "cpp-flag", []string{}, "set additional flag to pass to C preprocessor (cpp)")
254
+
fs.BoolVar(&flags.Preprocess, "preprocess", DefaultPreprocess(), "use the C preprocessor (cpp) on a Dockerfile, regardless of the file suffix. Use BUILDAH_PREPROCESS environment variable to change default.")
253
255
fs.BoolVar(&flags.CreatedAnnotation, "created-annotation", true, `set an "org.opencontainers.image.created" annotation in the image`)
254
256
fs.StringVar(&flags.Creds, "creds", "", "use `[username[:password]]` for accessing the registry")
0 commit comments