Docker can be treated as a useful tool to run applications; however, the real power lies in building own Docker images that wrap the programs together with the environment. In this section, we will see how to do this using two different methods, the Docker commit command and the Dockerfile automated build.
Building images
Docker commit
Let's start with an example and prepare an image with the Git and JDK toolkits. We will use Ubuntu 16.04 as a base image. There is no need to create it; most base images are available in the Docker Hub registry:
- Run a container from the ubuntu:16.04 and connect it to its command line:
$ docker run -i -t ubuntu:16.04 /bin/bash
We've pulled the ubuntu:16.04 image and run it...