For this part, you should have installed Docker for Desktop on your macOS or Windows PC. If you are on an older version of Windows or are using Windows 10 Home Edition, then you should have Docker Toolbox installed and ready to use. On macOS, use the Terminal application, and on Windows, a PowerShell or Bash console, to try out the commands you will be learning.
In the previous chapter, you learned how to optimally prepare your working environment for the productive and frictionless use of Docker. In this chapter, we are going to get our hands dirty and learn everything that is important to know when working with containers. Here are the topics we're going to cover in this chapter:
- Running the first container
- Starting, stopping, and removing containers
- Inspecting containers
- Exec into a running container
- Attaching to a running container
- Retrieving container logs
- Anatomy of containers
We learned so far what containers are and how to run, stop, remove, list, and inspect them. We extracted the logging information of some containers, ran other processes inside an already running container, and finally, we dived deep into the anatomy of containers. Whenever we ran a container, we created it using a container image. In this chapter, we will be familiarizing ourselves with these container images. We will learn in detail what they are, how to create them, and how to distribute them.
- What are images?
- Creating images
- Lift and shift: Containerizing a legacy app
- Sharing or shipping images
The following articles give you some more information related to the topics we discussed in this chapter:
- Docker containers at http://dockr.ly/2iLBV2I
- Getting started with containers at http://dockr.ly/2gmxKWB
- Isolating containers with a user namespace at http://dockr.ly/2gmyKdf
- Limiting a container's resources at http://dockr.ly/2wqN5Nn
- Best practices for writing Dockerfiles, at http://dockr.ly/22WiJiO
- Using multi-stage builds, at http://dockr.ly/2ewcUY3
- About storage drivers, at http://dockr.ly/1TuWndC
- Graphdriver plugins, at http://dockr.ly/2eIVCab
- User-guided caching in Docker for Mac, at http://dockr.ly/2xKafPf