Which TWO options are valid flags for the 'podman build' command to specify build arguments and tags? (Choose two.)
Trap 1: --volume
--volume mounts a host path or named volume into the build container; it does not pass build-time variables or name the resulting image. It is tempting because volumes are common in 'podman run', but for 'podman build' the argument flag is --build-arg and the tag flag is --tag.
Trap 2: --publish
--publish maps container ports to host ports at run time; it neither defines build arguments nor tags an image during 'podman build'. It is tempting because it is a familiar 'podman run' flag, but the build command's argument and tag flags are --build-arg and --tag.
Trap 3: --env-file
--env-file supplies environment variables to the running container at runtime, not build arguments or image tags during 'podman build'. It is tempting because it resembles --build-arg in passing variables, but build arguments require --build-arg, and tagging requires --tag.
- A
--volume
Why it fails: --volume mounts a host path or named volume into the build container; it does not pass build-time variables or name the resulting image. It is tempting because volumes are common in 'podman run', but for 'podman build' the argument flag is --build-arg and the tag flag is --tag.
- B
--publish
Why it fails: --publish maps container ports to host ports at run time; it neither defines build arguments nor tags an image during 'podman build'. It is tempting because it is a familiar 'podman run' flag, but the build command's argument and tag flags are --build-arg and --tag.
- C
--build-arg
--build-arg passes a named variable into the build at run time, letting a Containerfile consume values such as versions or credentials without hard-coding them. It satisfies the stem's requirement for specifying build arguments, distinct from --tag, which names the resulting image.
- D
-t / --tag
The `-t` / `--tag` flag assigns a name and optional tag to the resulting image in `name:tag` format, satisfying the stem's requirement to specify tags during `podman build`. It directly addresses the tagging half of the question, letting you label the built image for later reference.
- E
--env-file
Why it fails: --env-file supplies environment variables to the running container at runtime, not build arguments or image tags during 'podman build'. It is tempting because it resembles --build-arg in passing variables, but build arguments require --build-arg, and tagging requires --tag.