Year End Sale: Get Upto 40% OFF on Live Training! Offer Ending in
D
H
M
S
Get Now

Docker: Create an image with LABEL & ONBUILD instructions

Level : Beginner
Mentor: Shailendra Chauhan
Type : GuidedLab
Points : 10
Duration : 00:20:00

Lab Details

Problem Statement:

Write a Dockerfile that:

  • Uses the LABEL instruction to add metadata to the image.
  • Uses the ONBUILD instruction to define actions that will be executed when the image is used as a base for another build.
  • Verify the labels are correctly added by inspecting the image and testing the ONBUILD instruction by using the image in a subsequent Dockerfile.

Lab Objective:

Upon completion of this lab, you will be able to:

  • Use the LABEL instruction in a Dockerfile to add metadata to an image.
  • Implement the ONBUILD instruction to define actions for future builds based on the image.
  • Verify the application of LABEL and ONBUILD instructions by inspecting the image and testing them in subsequent builds.

Prerequisites

You should install the following software on your machine:

  • Docker
  • Text Editor
  • Terminal/Command Line Interface
Self-paced Membership
  • 24+ Video Courses
  • 825+ Hands-On Labs
  • 400+ Quick Notes
  • 125+ Skill Tests
  • 10+ Interview Q&A Courses
  • 10+ Real-world Projects
  • Career Coaching Sessions
  • Email Support
Upto 60% OFF
Know More
Still have some questions? Let's discuss.
CONTACT US
Accept cookies & close this