Docker · Arazzo Workflow
Docker Create a Volume and Mount It Into a Container
Version 1.0.0
Create a named volume, create a container that binds it to a mount path, start the container, and confirm the volume is in use.
Provider
Workflows
provision-volume-and-mount
Create a named volume and bring up a container with it mounted.
Creates a named volume with the local driver, creates a container that mounts that volume at the supplied target path, starts the container, and reads the volume back to confirm it exists and is in use.
1
createVolume
VolumeCreate
Create the named volume. Naming it explicitly is what separates it from an anonymous volume that would be swept away with the container.
2
createContainer
ContainerCreate
Create a container that mounts the named volume at the target path via a HostConfig volume mount, so data written there outlives the container.
3
startContainer
ContainerStart
Start the container so the volume is actually mounted and the workload can begin writing to it.
4
verifyMount
ContainerInspect
Inspect the container to confirm the daemon reports the named volume mounted at the expected target path.
5
inspectVolume
VolumeInspect
Read the volume back to capture its host mountpoint and usage data, which is what tells you whether it is in use or dangling.