Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Debugging a Packer Build

Packer lets us quickly and easily build machine images — at least, it does when everything works. Luckily, Packer provides us with two methods of debugging and testing our builds: the `-debug` flag and the breakpoint provisioner. In this lab, we'll use both of these tools to troubleshoot a troublesome build.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 19, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Test Build and Troubleshoot
    1. Test the build.
    2. Proceed until the build fails.
    3. In another terminal session, log in to the server a second time. Look for the LXD container from this build and access it via SSH.
    4. Troubleshoot.
    5. For some reason, our file downloaded as an HTML file, not a proper gzip archive! Should we look at the file itself, we can see we're being redirected. We can now close this window, finish our -debug Packer build, and take a look at our script where we download the Prometheus file.
    6. We pull down our gzip file on line 12. The curl command is properly structured, and it does pull down a file, but we'll need to add the -L flag, which will follow any redirects.
    7. Save and exit the file.
  2. Challenge

    Add the Breakpoint Provisioner

    Before we proceed with testing our fix, we want to add one more provisioner to our packer.json file to test our work and ensure Prometheus is running after our provisioning step runs successfully.

  3. Challenge

    Test the Build
    1. Run the build.
    2. When you hit the first breakpoint provisioner, access the Packer container and check the file type of the download.
    3. Stay logged in to the container as you progress to the next breakpoint, and then confirm Prometheus is working.
    4. Allow the build to finish.
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight