QuestionQ59

VerifiedDevSecOps Pipeline-Build and Test Stage

Robin Tunney works as a DevSecOps engineer at an IT company in Charleston, South Carolina. She wants to build a customized Docker image using HashiCorp Packer. To do this, she installed Packer and created a file named docker-ubuntu.pkr.hcl, added an HCL block to it, and saved the file.

Which of the following commands should Robin run to build the Docker image using Packer?

Explanation

HashiCorp Packer uses the packer build <template> subcommand to take a Packer template or set of HCL configuration files and run all the builds defined within it to generate one or more machine images. Since Robin created the HCL configuration in docker-ubuntu.pkr.hcl, she must run packer build docker-ubuntu.pkr.hcl to execute the build process and produce the Docker image. Packer's CLI is subcommand-based (e.g., build, validate, init, fmt) rather than using single-letter or word flags like -b or -build for this action.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!