O'Reilly logo

Configuration Management with Chef-Solo by Naveed ur Rahman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dockerfiles

As we have seen, we can execute individual commands from the Shell. Docker provides a decent method to invoke several commands and instructs the new container to perform a specific job.

Dockerfiles is a script based on different Docker commands. Each command contains an instruction, and it configures the new machine step by step. It can contain all the information from pulling a repository to starting any server.

They have a clean and simple syntax that makes a file more readable and clear. It is designed to be self-explanatory and allows commenting like other programming languages.

Here is an example of a file syntax:

# Comments
command argument argument …
# To echo Hello World
RUN echo "Hello World"

Let's create a basic Dockerfile ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required