Building a Docker Image using Packer and Jenkins

Hands-On Lab

Travis Thomsen

Course Development Director in Content

Length

01:00:00

Difficulty

Intermediate

In this hands-on lab, you will be taking on the role of a DevOps engineer who manages a Packer file that is used to create a Docker image for one of the team's applications. You have created a new Packer file and committed it to GitHub. Now you want to automate the build process. The team has a Jenkins server that is used for running tests against the code. You have decided to create a Jenkins job to help manage the build process.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Learn By Doing

Building a Docker Image using Packer and Jenkins

Introduction

In this hands-on lab, you will be taking on the role of a DevOps engineer who manages a Packer file that is used to create a Docker image for one of the team's applications. You have created a new Packer file and committed it to GitHub. Now you want to automate the build process. The team has a Jenkins server that is used for running tests against the code. You have decided to create a Jenkins job to help manage the build process.

Setting Up the Environment

Open your terminal application, and log in using the credentials provided on the lab instructions page.

ssh cloud_user@&amp;lt;PUBLIC_IP_ADDRESS&amp;gt;

Type yes at the prompt.

Enter your password at the prompt.

Open Port 8080 on the Firewall

From your terminal, open port 8080.

firewall-cmd --zone=public --permanent --add-port=8080/tcp

Reload the firewall.

firewall-cmd --reload

Open your web browser.

In the address bar, enter the following: http://&lt;IP_ADDRESS&gt;:8080