Book Image

Docker Quick Start Guide

By : Earl Waud
Book Image

Docker Quick Start Guide

By: Earl Waud

Overview of this book

Docker is an open source software platform that helps you with creating, deploying, and running your applications using containers. This book is your ideal introduction to Docker and containerization. You will learn how to set up a Docker development environment on a Linux, Mac, or Windows workstation, and learn your way around all the commands to run and manage your Docker images and containers. You will explore the Dockerfile and learn how to build your own enterprise-grade Docker images. Then you will learn about Docker networks, Docker swarm, and Docker volumes, and how to use these features with Docker stacks in order to define, deploy, and maintain highly-scalable, fault-tolerant multi-container applications. Finally, you will learn how to leverage Docker with Jenkins to automate the building of Docker images and the deployment of Docker containers. By the end of this book, you will be well prepared when it comes to using Docker for your next project.
Table of Contents (10 chapters)

Removing volumes

We have already seen and used the volume list command, volume ls, and the inspect command, volume inspect, and I think you should have a good grasp of what these commands do. There are two other commands in the volume-management group, both for volume removal. The first is the volume rm command, which you can use to remove one or more volumes by name. Then, there is the volume prune command; with the prune command, you can remove ALL unused volumes. Be extra careful with the use of this command. Here is the syntax for the remove and prune commands:

# Remove volumes command syntax
Usage: docker volume rm [OPTIONS] VOLUME [VOLUME...]
# Prune volumes command syntax
Usage: docker volume prune [OPTIONS]

Here are some examples of using the remove and prune commands:

Since the in-use-volume volume is mounted in the vol-demo container, it did not get removed with the prune...