captjack on Nostr: *** mounting host directory to container directly *** - any edit visible in both. ...
*** mounting host directory to container directly *** - any edit visible in both. -🇻 flag
$ docker run -it --rm -v /home/user1/hostpath:/home/cont_path ubuntu /bin/bash
root@e8439d98c635:/#
#linuxstr #docker #techtip *** must do at start or else hav2 stop - do - restart
very useful if using hot swap SATA SSD mSATA disks without reboot host system.
Let’s break down this command:
-i -t (or -it) enables interactive access to the container
–rm removes the container upon exit to free system resources (CPU, memory)
/path/on/host is the path of the directory on the host machine that we want to mount
/path/in/container is the desired path within the container where the directory will be accessible
image_name is the name or ID of the Docker image we want to run
/bin/bash provides a Bash shell within the container
Published at
2024-09-28 14:10:29Event JSON
{
"id": "8a5aa664758f2e75d4da5c9a67765927a480f3dc157039c83263f46a9d0686d0",
"pubkey": "5e5fc1434c928bcdcba6f801859d5238341093291980fd36e33b7416393d5a2c",
"created_at": 1727532629,
"kind": 1,
"tags": [
[
"t",
"linuxstr"
],
[
"t",
"docker"
],
[
"t",
"techtip"
]
],
"content": "*** mounting host directory to container directly *** - any edit visible in both. -🇻 flag\n$ docker run -it --rm -v /home/user1/hostpath:/home/cont_path ubuntu /bin/bash\nroot@e8439d98c635:/#\n#linuxstr #docker #techtip *** must do at start or else hav2 stop - do - restart\nvery useful if using hot swap SATA SSD mSATA disks without reboot host system.\nLet’s break down this command:\n -i -t (or -it) enables interactive access to the container\n –rm removes the container upon exit to free system resources (CPU, memory)\n /path/on/host is the path of the directory on the host machine that we want to mount\n /path/in/container is the desired path within the container where the directory will be accessible\n image_name is the name or ID of the Docker image we want to run\n /bin/bash provides a Bash shell within the container\n https://image.nostr.build/d2f224246ac2d234f5848afa47861c547822c06b5ca51b2946770fac68335f00.png \n\n\n",
"sig": "376f85da8c9cdfd47ba1cdc03979b8a2fd538764f955933f40f68464540f90fec2e221db943183250952264cf73db578e6d64a685263d4b758d1e2fc71b17df3"
}