makeporngreatagain.pro
yeahporn.top
hd xxx

Docker Volumes

261
  1. Create a directory on the host with some test data.
    cd ~/
    mkdir message
    echo Hello, world! > message/message.txt
  2. Mount the directory to a container with a bind mount.
    docker run --mount type=bind,source=/home/cloud_user/message,destination=/root,readonly busybox cat /root/message.txt
  3. Run a container with a mounted volume.
    docker run --mount type=volume,source=my-volume,destination=/root busybox sh -c 'echo hello > /root/message.txt && cat /root/message.txt'
  4. Use the -v syntax to create a bind mount and a volume.
    docker run -v /home/cloud_user/message:/root:ro busybox cat /root/message.txt
    docker run -v my-volume:/root busybox sh -c 'cat /root/message.txt'
  5. Use a volume to share data between containers.
    docker run --mount type=volume,source=shared-volume,destination=/root busybox sh -c 'echo I wrote this! > /root/message.txt'
    docker run --mount type=volume,source=shared-volume,destination=/anotherplace busybox cat /anotherplace/message.txt
  6. Create and manage volumes using docker volume commands.
    docker volume create test-volume
    docker volume ls
    docker volume inspect test-volume
    docker volume rm test-volume

Comments are closed, but trackbacks and pingbacks are open.

baseofporn.com https://www.opoptube.com
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.