Ignoring Files During Docker Build

1 hour
  • 2 Learning Objectives

About this Hands-on Lab

As the Radar Board (the official SpaceBones government tech team) works toward implementing a true CI/CD environment, there have been reports of random files, directories, and other items interrupting the Docker automation process.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create .dockerignore

Edit the included .dockerignore file, under ~/content-dockerquest-spacebones/salt-example/salt-master/, to ignore badscript.sh, README.md, and all conf files.

Build the Docker Image

Create a new Docker image named salt-master:deb.

Additional Resources

As the resident Docker expert, President Squawk and the Radar Board have requested your aid in ignoring a few configuration files in the ~/content-dockerquest-spacebones/salt-example/salt-master/ directory. Populate the included .dockerignore file to prevent docker build from including incorrect or unneeded files in the build. Once complete, only docker-entrypoint.sh should live on the new image.

Once you have populated .dockerignore, build a new Docker container image named salt-master with the tag :deb.

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?