Last updated
Last updated
Volumes are the preferred method of maintaining persistent data in Docker. In this lesson, we will begin learning how to use the volume subcommand to list, create, and remove volumes.
Step 1: List all Docker volume commands:
create: Create a volume.
inspect: Display detailed information on one or more volumes.
ls: List volumes.
prune: Remove all unused local volumes.
rm: Remove one or more volumes.
Step 2: List all volumes on a host:
Step 3: Create two new volumes:
Step 4: Get the flags available when creating a volume:
Step 5: Inspecting a volume:
Step 6: Deleting a volume:
Removing all unused volumes: