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
@@ -820,6 +820,13 @@ The `buildah build` command allows building images for all Linux architectures,
820
820
821
821
**NOTE:** The `--platform` option may not be used in combination with the `--arch`, `--os`, or `--variant` options.
822
822
823
+
**--preprocess**
824
+
825
+
If specified, will always attempt to use the C Preprocessor cpp(1),
826
+
even if the Containerfile doesn't end with the ".in" suffix.
827
+
Note: You can also configure this behavior by setting the BUILDAH\_PREPROCESS
828
+
environment variable to `1`, `true`, or `yes`.
829
+
823
830
**--pull**
824
831
825
832
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.")
248
249
fs.BoolVar(&flags.InheritAnnotations, "inherit-annotations", true, "inherit the annotations from the base image or base stages.")
249
250
fs.StringArrayVar(&flags.CPPFlags, "cpp-flag", []string{}, "set additional flag to pass to C preprocessor (cpp)")
251
+
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.")
250
252
fs.BoolVar(&flags.CreatedAnnotation, "created-annotation", true, `set an "org.opencontainers.image.created" annotation in the image`)
251
253
fs.StringVar(&flags.Creds, "creds", "", "use `[username[:password]]` for accessing the registry")
0 commit comments