Building a LXD Image with Packer

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

Packer allows us to create machine images using a number of builders — including LXC images! By using the LXC builder, we can use `lxc` (or lxc1 — not LXD) to create gzipped images of the root file system that we can later deploy using operating system-level virtualization. In this hands-on lab, we’ll prepare a web image with Packer and LXC.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Write the Packer Template
  1. Move into the packer/booksite directory.
  2. Write the template based on the provided instructions.
Test the Build
  1. Validate the JSON.
  2. Test the build.

Additional Resources

You are a DevOps Engineer in charge of automating all builds. The frontend team has provided you with the website files that need to be uploaded, and you've crafted a script to provision the container. Create a Packer template using the LXC builder to create a web image using Ubuntu 18.04.

What are Hands-on Labs

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.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?