Optimizing Docker Builds with OnBuild

1 hour
  • 2 Learning Objectives

About this Hands-on Lab

### Optimizing Docker Builds with OnBuild

Onward, onward, On…Build? Inspired by the speed & resourcefulness that you have shown while completing various tasks, the Radar Board (The official SpaceBones government tech team) have now decided to begin to kinda work towards the eventual implementation of a full CI/CD pipeline environment… maybe. Don’t worry, the majority of this task will land squarely on the shoulders of those noble ladies & gents, but — based on President Squawk’s sparking recommendation based on your performance thus far — the Radar Board have requested your assistance with one task as they prepare a Saltstack backend.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Add OnBuild Instruction to Dockerfile

student should edit dockerfile under ~/content-dockerquest-spacebones/salt-example/salt-master/ to include an OnBuild instruction

Create Parent Image

student should create a parent image named tablesalt with the tag, master

Additional Resources

As the Radar Board prepares to integrate Saltstack with their environment using Docker images, they have requested your aid with preparing a parent image for what will eventually become the master node, using OnBuild. Using the Dockerfile included under ~/content-dockerquest-spacebones/salt-example/salt-master/, create a new parent image for the salt-master build named tablesalt:master that executes all commands against docker-entrypoint.sh on any child images created from the parent image. Good luck!

Here is the content-dockerrequest repo: https://github.com/linuxacademy/content-dockerquest-spacebones

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?