Chapter 6. Day-to-day Docker

 

This chapter covers

  • Keeping a handle on your container and volume space usage
  • Detaching from containers without stopping them
  • Visualizing your Docker image lineage in a graph
  • Running commands directly on your containers from the host

As with any moderately complex software project, Docker has a lot of nooks and crannies that are important to know about if you want to keep your experience as smooth as possible.

This chapter’s techniques will show you some of the more important of these, as well as introduce some external tools built by third parties to scratch their own itches. Think of it as your Docker toolbox.

6.1. Staying ship-shape

If you’re anything like us (and if you’re following this book studiously), your growing Docker addiction will mean that you start up numerous containers on, and download a variety of images to, your chosen host.

As time goes on, Docker will take up more and more resources, and some housekeeping of containers and volumes will be required. We’ll show you the how and why of this. We’ll also introduce some visual tools for keeping your Docker environment clean and tidy, in case you want an escape from the command line.

Running containers is all very well, but you’ll fairly quickly find yourself wanting to do more than just start a single command in the foreground. We’ll take a look at escaping a running container without killing it, and at executing commands inside a running container.

Summary