As you can recall from Chapter 6, Creating Images, when we create a Docker image, we provide the default command or options either using the CMD
instruction or default command to execute at runtime using the ENTRYPOINT
instruction. But without the possibility to influence the container startup process by providing different commands or parameters, other than the image author provided, it wouldn't be possible to use Docker in many cases. Images would be rather static and sometimes just useless. Luckily, Docker supports overriding those defaults and this feature makes it very flexible tool. As you remember from the previous chapter, there's an important difference between ENTRYPOINT
and CMD
instructions: the ENTRYPOINT
defines the process that runs as PID 1
in the container and the CMD
provides options for it. If the ENTRYPOINT
has not been specified in the Dockerfile, but CMD
was, then the shell /bin/sh -c
will be the image's entry point. The CMD...
Developing with Docker
By :
Developing with Docker
By:
Overview of this book
This fast-paced practical guide will get you up and running with Docker. Using Docker, you will be able to build, ship, and run many distributed applications in real time.
You will start with quickly installing Docker and start working with images and containers. We will present different types of containers and their applications, and show you how to find and build images. You will learn how you can contribute to the image repository by publishing different images. This will familiarize you with the image building process and you will be able to successfully run your programs within containers.
By finishing this book, you will be well equipped in deploying your applications using Docker and will have a clear understanding of concepts, techniques, and practical methods to get it running in production systems.
Table of Contents (16 chapters)
Developing with Docker
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Free Chapter
Introduction to Docker
Installing Docker
Understanding Images and Containers
Networking and Persistent Storage
Finding Images
Creating Images
Running Containers
Publishing Images
Using Docker in Development
More Resources
Customer Reviews