history: Shows the creation and build process for an image.
inspect: Provides detailed information on all aspects of an image,
including layer detail.
rm: Deletes an image from local storage.
In the previous example, you built a Dockerfile using the
latest Ubuntu base and then updated and upgraded the
Ubuntu base so that its packages are current. You then
installed nginx, shared a mount point, and exposed ports
to access the new web server. The next step is to kick off
the build process with Docker. While in the directory
where you created your Dockerfile, execute the build
process as shown in Example 13-6.
Example 13-6 Building a Container from a Dockerfile
Click here to view code image
$ docker build -t myimage:latest.
Sending build context to Docker daemon 2.048kB
Step 1/8 : FROM ubuntu:latest
---> 775349758637
Step 2/8 : MAINTAINER Cisco Champion
([email protected])
---> Using cache
---> f83e0f07db18
Step 3/8 : RUN apt-get update
---> Using cache
---> 646cc0e9f256
Step 4/8 : RUN apt-get upgrade -y
---> Using cache
---> c2701f555b0f
Step 5/8 : RUN apt-get install nginx -y
---> Using cache
---> 4abf50fd4a02
Step 6/8 : EXPOSE 80 443
---> Using cache
---> a9a1533064b2
Step 7/8 : VOLUME /usr/share/nginx/html
---> Using cache
---> 2ecd13c5af2b
Step 8/8 : CMD ["nginx", "-g", "daemon off;"]
---> Running in e03bd2387319
Removing intermediate container e03bd2387319
---> 04ae8c714993
Successfully built 04ae8c714993
Successfully tagged myimage:latest