Getting started with Docker
We have created a GitHub repository to share code examples for this book. The repository can be found at https://github.com/PacktPublishing/Docker-for-Developers. You should fork this repository, and then clone it to your host. Creating the fork means you can manage your copy of the repository as you see fit without requiring permissions. The code of interest for this section is in the chapter2/
directory. The code here implements a small Apache+PHP application that is designed to run in a container. There are sh
scripts to perform the Docker command lines, so you don't have to keep typing in a long string of command-line arguments.
Before we get into the code, let's make sure that Docker is installed properly. The docker ps
command prints a list of all running Docker containers. We can see we have no containers running and there is an actual docker
command:
% docker ps CONTAINER IDÂ Â Â Â Â Â Â Â IMAGEÂ ...