Tools, FAQ, Tutorials:
Docker Data Storage - Multiple Mounts
How to create multiple mounts to a Docker container?
✍: FYIcenter.com
Some times you may need to create multiple mounts to a new Docker container.
This can be done by using "--mount" options
as shown in this tutorial.
1. Run a new Docker container with 2 bind mounts:
fyicenter# docker run \ --mount type=bind,source=/tmp,destination=/tmp \ --mount type=bind,source=/mnt,destination=/mnt \ -tid --name fyi_test alpine fyicenter# docker exec -it fyi_test /bin/sh / # df -h Filesystem 1K-blocks Used Available Use% Mounted on overlay 52403200 23384140 29019060 45% / tmpfs 65536 0 65536 0% /dev tmpfs 3872692 0 3872692 0% /sys/fs/cgroup shm 65536 0 65536 0% /dev/shm /dev/mapper/cl-root 52403200 23384140 29019060 45% /tmp /dev/mapper/cl-root 52403200 23384140 29019060 45% /mnt /dev/mapper/cl-root 52403200 23384140 29019060 45% /etc/resolv.conf /dev/mapper/cl-root 52403200 23384140 29019060 45% /etc/hostname /dev/mapper/cl-root 52403200 23384140 29019060 45% /etc/hosts ...
2. Stop and remove the Docker container.
/ # exit fyicenter# docker container stop fyi_test fyi_test fyicenter# docker container rm fyi_test fyi_test
⇒ Building Docker Image with "docker build"
⇐ Docker Data Storage - Bind Mounts
2021-08-15, 834🔥, 0💬
Popular Posts:
How to include additional claims in Azure AD v2.0 id_tokens? If you want to include additional claim...
How to use the urllib.request.Request object to build more complex HTTP request? The urllib.request....
How to use the "set-backend-service" Policy Statement for an Azure API service operation? The "set-b...
What's Wrong with "while ($c=fgetc($f)) {}" in PHP? If you are using "while ($c=fgetc($f)) {}" to lo...
Where to find tutorials on PHP language? I want to know how to learn PHP. Here is a large collection...