{"_id":"5819dff4b1498a25008d2a4f","parentDoc":null,"user":"5767bc73bb15f40e00a28777","version":{"_id":"55faf11ba62ba1170021a9aa","project":"55faf11ba62ba1170021a9a7","__v":38,"createdAt":"2015-09-17T16:58:03.490Z","releaseDate":"2015-09-17T16:58:03.490Z","categories":["55faf11ca62ba1170021a9ab","55faf8f4d0e22017005b8272","55faf91aa62ba1170021a9b5","55faf929a8a7770d00c2c0bd","55faf932a8a7770d00c2c0bf","55faf94b17b9d00d00969f47","55faf958d0e22017005b8274","55faf95fa8a7770d00c2c0c0","55faf96917b9d00d00969f48","55faf970a8a7770d00c2c0c1","55faf98c825d5f19001fa3a6","55faf99aa62ba1170021a9b8","55faf99fa62ba1170021a9b9","55faf9aa17b9d00d00969f49","55faf9b6a8a7770d00c2c0c3","55faf9bda62ba1170021a9ba","5604570090ee490d00440551","5637e8b2fbe1c50d008cb078","5649bb624fa1460d00780add","5671974d1b6b730d008b4823","5671979d60c8e70d006c9760","568e8eef70ca1f0d0035808e","56d0a2081ecc471500f1795e","56d4a0adde40c70b00823ea3","56d96b03dd90610b00270849","56fbb83d8f21c817002af880","573c811bee2b3b2200422be1","576bc92afb62dd20001cda85","5771811e27a5c20e00030dcd","5785191af3a10c0e009b75b0","57bdf84d5d48411900cd8dc0","57ff5c5dc135231700aed806","5804caf792398f0f00e77521","58458b4fba4f1c0f009692bb","586d3c287c6b5b2300c05055","58ef66d88646742f009a0216","58f5d52d7891630f00fe4e77","59a555bccdbd85001bfb1442"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"57ff5c5dc135231700aed806","__v":0,"version":"55faf11ba62ba1170021a9aa","project":"55faf11ba62ba1170021a9a7","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-10-13T10:05:17.381Z","from_sync":false,"order":16,"slug":"tool-wrapping-troubleshooting","title":"TOOL WRAPPING TIPS AND TRICKS"},"project":"55faf11ba62ba1170021a9a7","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-11-02T12:45:40.700Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"This page is intended to show you how to use files stored on an external USB drive inside the Docker container where the tool you want to use on the CGC is installed. During the development process of a tool that will eventually be used on the CGC, you might first want develop a Docker image locally, verify its operation on a few realistic test data files, and then upload the validated image to the CGC to run at scale.\n\nSince the data files in genomic big data analyses tend to be quite large, it's likely that you will be keeping those files on an external USB storage drive, rather than an internal hard drive on your computer. If you are working locally on an OS X or Windows machine, there are several set up steps that need to be performed before being able to mount a USB drive in a Docker container, while this functionality is supported natively in Linux.\n\n## Set up the USB drive mount point on a Linux host\n\nIf trying to mount a USB drive in a Docker container on Linux, proceed as follows:\n1. Once you have inserted the USB drive into your computer, enter the following command:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"sudo fdisk -l\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nThis will list all available partitions within the system. The name of your device should be similar to e.g. `/dev/sdb1`.\n2. Create the directory which will be used as the mount point for your USB drive:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"sudo mkdir /mnt/usb\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\n3. Mount the device:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"sudo mount /dev/sdb1 /mnt/usb\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nOnce you have completed the previous procedure, follow <a href=\"#stepthree\">step 3</a> in the Docker Toolbox for OS X procedure below.\n\n## Set up the USB drive mount point on an OS X host\n\n### Docker for Mac\n\nIf you are using Docker for Mac on an OS X machine, to prepare the drive for mounting in a Docker container, proceed as follows:\n1. Open the terminal.\n2. Enter the following command:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"mount\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nThis command will display all mounted drives on your machine. Find the identifier that corresponds to your USB drive, for example `/dev/disk3s1`.\n\n3. Unmount the drive:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"diskutil unmount /dev/disk3s1\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nMake sure to replace `/dev/disk3s1` with the identifier of your USB drive.\n\n4. Create the folder that will serve as the new mount point on OS X:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"sudo mkdir -p /mnt/usb\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\n5. Mount the USB drive to the newly created mount point.\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"sudo diskutil mount -mountPoint /mnt/usb /dev/disk3s1\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nAgain, make sure to replace `dev/disk3s1` with the identifier of your USB drive.\n\n6. Verify that the drive has been properly mounted:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"ls /mnt/usb\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nBefore you can mount your USB drive in a Docker container, you need to add the `/mnt` folder to the list of shared directories in Docker for Mac:\n1. On the main menu bar click the Docker for Mac icon <img src=\"https://files.readme.io/37b372b-docker_for_mac_icon.png\" height=\"22px\" width=\"auto\" align=\"inline\" style=\"margin:1px\"/>.\n2. Select **Preferences**.\n3. Open the **File Sharing** tab.\n4. Click **+** in the bottom-left corner of the list.\n5. Navigate to the `/mnt` directory and click **Open**.\n6. Click **Apply & Restart**.\n\nOnce you have completed the previous procedure, follow <a href=\"#stepthree\">step 3</a> in the Docker Toolbox procedure below.\n\n### Docker Toolbox\nIf you are using Docker Toolbox on OS X, mounting an external USB drive in a Docker container is a three part process.\n\n**1. Add a shared folder to the Oracle VirtualBox Virtual Machine**\nIn the [Installing Docker on OS X](doc:upload-your-docker-image#section-installing-docker-on-os-x) section, we have previously described how you can install Docker Toolbox, which also includes Docker Machine and Oracle VirtualBox. To mount a USB hard drive inside a Docker container, the first step is to go back and modify the configuration of this virtual machine by adding a \"shared folder\". This is done using the VirtualBox GUI manager, in which case the virtual machine does not need to be stopped.\n\nTo add a shared folder:\n1. Insert the USB drive in your computer and make sure it is properly mounted and visible in the operating system.\n[block:callout]\n{\n \"type\": \"warning\",\n \"body\": \"This step needs to be performed while the virtual machine created by Docker is stopped. To check the status of the virtual machine, enter the following command:\\n`docker-machine ls`\\nIf the state of the machine used by Docker is **Running**, stop it using the following command:\\n`docker-machine stop default`\\nThe machine that is automatically created by Docker is named **default**. If you have changed the name, make sure to replace default in the command above.\"\n}\n[/block]\n2. Start Docker by running the Docker Quickstart Terminal that comes as a part of [Docker Toolbox](https://docs.docker.com/engine/installation/mac/#/docker-toolbox).\n3. Use **Finder** to open the VirtualBox Manager by double-clicking **VirtualBox** in the **Applications** folder.\n4. In the left pane, select the virtual machine used by Docker. The machine is named **default**, unless you have renamed it.\n5. Click **Shared Folders**.\n[block:image]\n{\n \"images\": [\n {\n \"image\": [\n \"https://files.readme.io/bc3c8cf-mac-usb-1.jpg\",\n \"mac-usb-1.jpg\",\n 1010,\n 831,\n \"#e3e3e4\"\n ]\n }\n ]\n}\n[/block]\n6. Click <img src=\"https://files.readme.io/9f7d059-mac-usb-icon-addfolder.png\"\nheight=\"14px\" width=\"auto\" align=\"inline\" style=\"margin:1px\"/> to add a new folder:\n a. In the **Folder Path** field enter the path to your USB drive.\n b. In the **Folder Name** field enter the name of your shared folder. In this example, we named the folder `usbdrive`.\n c. Check the **Auto-mount** and **Make Permanent** options.\n[block:image]\n{\n \"images\": [\n {\n \"image\": [\n \"https://files.readme.io/a2a3733-mac-usb-3.jpg\",\n \"mac-usb-3.jpg\",\n 379,\n 254,\n \"#e9e9e9\"\n ]\n }\n ]\n}\n[/block]\n7. Click **OK**.\nThis will add a shared folder and associate it with the OS X mount point of the USB drive.\n\n**2. Mount the USB drive Inside the VirtualBox Virtual Machine**\n\n1. Connect to the default virtual machine through SSH by entering the following command into the terminal:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"docker-machine ssh default\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nThe machine that is automatically created by Docker is named **default**. If you have changed the name, make sure to replace default in the command above.\n\n2. Create the `/mnt/usb` directory which will be used as the mount point for the `usbdrive` shared folder that you have already created.\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"sudo mkdir /mnt/usb\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\n3. Create an association between the `usbdrive` shared folder and the `/mnt/usb` directory:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"sudo mount -t vboxsf -o defaults,uid=`id -u docker`,gid=`id -g docker` usbdrive /mnt/usb\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nIn our example, the shared folder is named `usbdrive`. If you named your shared folder differently, make sure to replace `usbdrive` in the expression above.\n\n4. After the mount command has been executed, verify that the `/mnt/usb` directory holds the contents of your USB disk:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"ls /mnt/usb\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nA key limitation of the method above is that although the created shared folder persists even after a reboot, while the mount itself that we created in step 2 does not; therefore, this step must be re-executed every time the virtual machine is rebooted. However, the mount can be made permanent by placing the `mkdir` and `mount` commands in an appropriately located system bootup script:\n\n1. While logged into the virtual machine through SSH, enter the following command:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"sudo vi /mnt/sda1/var/lib/boot2docker/bootlocal.sh\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nThis will create a blank bootup script `bootlocal.sh`.\n2. Press the **I** key to start editing.\n3. Enter the following two lines:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"mkdir -p /mnt/usb\\nmount -t vboxsf -o defaults,uid=`id -u docker`,gid=`id -g docker` usbdrive /mnt/usb\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\n4. Press **Esc** on the keyboard.\n5. Type `:x` and press **Enter**.\nThe bootup script is now saved. The `usbdrive` shared folder will be mounted automatically every time the **default** virtual machine is started.\n\n<a name=\"stepthree\" style=\"text-decoration: none; color: #474a54;\">**3. Mount the USB drive mount point in Docker**</a>\n\n1. Launch a Docker container, and use the `-v` flag to mount the `/mnt/usb` directory from the default virtual machine as `/opt/usb` in the container:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"docker run -i -t -v /mnt/usb:/opt/usb ubuntu /bin/bash\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nThe -v argument is used in the following format: `-v <local_path>:<container_path>`.\n\n2. You can easily verify that the mount has been performed correctly using `ls`:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"ls /opt/usb\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nIf all steps have been performed correctly, you should be able to see the contents of your USB drive from the Docker container.\n\n## Mount the USB drive in a Docker container on a Windows host with Docker for Windows\nIf you are using Docker for Windows, proceed as follows:\n1. Right-click the Docker icon <img src=\"https://files.readme.io/0f79774-docker_for_mac_icon_win.png\"\nheight=\"22px\" width=\"auto\" align=\"inline\" style=\"margin:1px\"/> in system tray and select **Settings**.\n2. Select the **Shared Drives** tab on the left.\nYou will now see a list of drives on your computer.\n3. Click the box in the **Shared** column next to the drive you want to mount in your Docker container.\n4. If prompted, enter your Windows credentials. You can click the **Remember me** box and allow Docker to store your credentials for future use.\n[block:callout]\n{\n \"type\": \"warning\",\n \"body\": \"The account used to authenticate with your **Shared Drives** needs to be the same as the one used to run docker commands. Otherwise, you will not be able to access the shared drive from your container. Also, for security reasons you will not be able to use an account that doesn't have a defined password.\"\n}\n[/block]\n5. Click **OK**.\n\nOnce this procedure has been completed, open Windows PowerShell and enter the following command:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"docker run -ti -v d:/:/data ubuntu /bin/bash\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nThe `-v` argument is used in the following format: `-v <local_path>:<container_path>`. In this case, make sure to replace `d:/` with the actual letter of your USB drive on the local machine.\n\nTo verify that the drive has been properly mounted inside the container, enter:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"ls /data\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\nYou will now see a list of files and directories on your USB drive.","excerpt":"","slug":"mount-a-usb-drive-in-a-docker-container","type":"basic","title":"Mount a USB drive in a Docker container"}

SBFS (Beta)

Mount a USB drive in a Docker container

This page is intended to show you how to use files stored on an external USB drive inside the Docker container where the tool you want to use on the CGC is installed. During the development process of a tool that will eventually be used on the CGC, you might first want develop a Docker image locally, verify its operation on a few realistic test data files, and then upload the validated image to the CGC to run at scale.
Since the data files in genomic big data analyses tend to be quite large, it's likely that you will be keeping those files on an external USB storage drive, rather than an internal hard drive on your computer. If you are working locally on an OS X or Windows machine, there are several set up steps that need to be performed before being able to mount a USB drive in a Docker container, while this functionality is supported natively in Linux.
## Set up the USB drive mount point on a Linux host
If trying to mount a USB drive in a Docker container on Linux, proceed as follows:
1. Once you have inserted the USB drive into your computer, enter the following command:
[block:code]
{
"codes": [
{
"code": "sudo fdisk -l",
"language": "shell"
}
]
}
[/block]
This will list all available partitions within the system. The name of your device should be similar to e.g. `/dev/sdb1`.
2. Create the directory which will be used as the mount point for your USB drive:
[block:code]
{
"codes": [
{
"code": "sudo mkdir /mnt/usb",
"language": "shell"
}
]
}
[/block]
3. Mount the device:
[block:code]
{
"codes": [
{
"code": "sudo mount /dev/sdb1 /mnt/usb",
"language": "shell"
}
]
}
[/block]
Once you have completed the previous procedure, follow <a href="#stepthree">step 3</a> in the Docker Toolbox for OS X procedure below.
## Set up the USB drive mount point on an OS X host
### Docker for Mac
If you are using Docker for Mac on an OS X machine, to prepare the drive for mounting in a Docker container, proceed as follows:
1. Open the terminal.
2. Enter the following command:
[block:code]
{
"codes": [
{
"code": "mount",
"language": "shell"
}
]
}
[/block]
This command will display all mounted drives on your machine. Find the identifier that corresponds to your USB drive, for example `/dev/disk3s1`.
3. Unmount the drive:
[block:code]
{
"codes": [
{
"code": "diskutil unmount /dev/disk3s1",
"language": "shell"
}
]
}
[/block]
Make sure to replace `/dev/disk3s1` with the identifier of your USB drive.
4. Create the folder that will serve as the new mount point on OS X:
[block:code]
{
"codes": [
{
"code": "sudo mkdir -p /mnt/usb",
"language": "shell"
}
]
}
[/block]
5. Mount the USB drive to the newly created mount point.
[block:code]
{
"codes": [
{
"code": "sudo diskutil mount -mountPoint /mnt/usb /dev/disk3s1",
"language": "shell"
}
]
}
[/block]
Again, make sure to replace `dev/disk3s1` with the identifier of your USB drive.
6. Verify that the drive has been properly mounted:
[block:code]
{
"codes": [
{
"code": "ls /mnt/usb",
"language": "shell"
}
]
}
[/block]
Before you can mount your USB drive in a Docker container, you need to add the `/mnt` folder to the list of shared directories in Docker for Mac:
1. On the main menu bar click the Docker for Mac icon <img src="https://files.readme.io/37b372b-docker_for_mac_icon.png" height="22px" width="auto" align="inline" style="margin:1px"/>.
2. Select **Preferences**.
3. Open the **File Sharing** tab.
4. Click **+** in the bottom-left corner of the list.
5. Navigate to the `/mnt` directory and click **Open**.
6. Click **Apply & Restart**.
Once you have completed the previous procedure, follow <a href="#stepthree">step 3</a> in the Docker Toolbox procedure below.
### Docker Toolbox
If you are using Docker Toolbox on OS X, mounting an external USB drive in a Docker container is a three part process.
**1. Add a shared folder to the Oracle VirtualBox Virtual Machine**
In the [Installing Docker on OS X](doc:upload-your-docker-image#section-installing-docker-on-os-x) section, we have previously described how you can install Docker Toolbox, which also includes Docker Machine and Oracle VirtualBox. To mount a USB hard drive inside a Docker container, the first step is to go back and modify the configuration of this virtual machine by adding a "shared folder". This is done using the VirtualBox GUI manager, in which case the virtual machine does not need to be stopped.
To add a shared folder:
1. Insert the USB drive in your computer and make sure it is properly mounted and visible in the operating system.
[block:callout]
{
"type": "warning",
"body": "This step needs to be performed while the virtual machine created by Docker is stopped. To check the status of the virtual machine, enter the following command:\n`docker-machine ls`\nIf the state of the machine used by Docker is **Running**, stop it using the following command:\n`docker-machine stop default`\nThe machine that is automatically created by Docker is named **default**. If you have changed the name, make sure to replace default in the command above."
}
[/block]
2. Start Docker by running the Docker Quickstart Terminal that comes as a part of [Docker Toolbox](https://docs.docker.com/engine/installation/mac/#/docker-toolbox).
3. Use **Finder** to open the VirtualBox Manager by double-clicking **VirtualBox** in the **Applications** folder.
4. In the left pane, select the virtual machine used by Docker. The machine is named **default**, unless you have renamed it.
5. Click **Shared Folders**.
[block:image]
{
"images": [
{
"image": [
"https://files.readme.io/bc3c8cf-mac-usb-1.jpg",
"mac-usb-1.jpg",
1010,
831,
"#e3e3e4"
]
}
]
}
[/block]
6. Click <img src="https://files.readme.io/9f7d059-mac-usb-icon-addfolder.png"
height="14px" width="auto" align="inline" style="margin:1px"/> to add a new folder:
a. In the **Folder Path** field enter the path to your USB drive.
b. In the **Folder Name** field enter the name of your shared folder. In this example, we named the folder `usbdrive`.
c. Check the **Auto-mount** and **Make Permanent** options.
[block:image]
{
"images": [
{
"image": [
"https://files.readme.io/a2a3733-mac-usb-3.jpg",
"mac-usb-3.jpg",
379,
254,
"#e9e9e9"
]
}
]
}
[/block]
7. Click **OK**.
This will add a shared folder and associate it with the OS X mount point of the USB drive.
**2. Mount the USB drive Inside the VirtualBox Virtual Machine**
1. Connect to the default virtual machine through SSH by entering the following command into the terminal:
[block:code]
{
"codes": [
{
"code": "docker-machine ssh default",
"language": "shell"
}
]
}
[/block]
The machine that is automatically created by Docker is named **default**. If you have changed the name, make sure to replace default in the command above.
2. Create the `/mnt/usb` directory which will be used as the mount point for the `usbdrive` shared folder that you have already created.
[block:code]
{
"codes": [
{
"code": "sudo mkdir /mnt/usb",
"language": "shell"
}
]
}
[/block]
3. Create an association between the `usbdrive` shared folder and the `/mnt/usb` directory:
[block:code]
{
"codes": [
{
"code": "sudo mount -t vboxsf -o defaults,uid=`id -u docker`,gid=`id -g docker` usbdrive /mnt/usb",
"language": "shell"
}
]
}
[/block]
In our example, the shared folder is named `usbdrive`. If you named your shared folder differently, make sure to replace `usbdrive` in the expression above.
4. After the mount command has been executed, verify that the `/mnt/usb` directory holds the contents of your USB disk:
[block:code]
{
"codes": [
{
"code": "ls /mnt/usb",
"language": "shell"
}
]
}
[/block]
A key limitation of the method above is that although the created shared folder persists even after a reboot, while the mount itself that we created in step 2 does not; therefore, this step must be re-executed every time the virtual machine is rebooted. However, the mount can be made permanent by placing the `mkdir` and `mount` commands in an appropriately located system bootup script:
1. While logged into the virtual machine through SSH, enter the following command:
[block:code]
{
"codes": [
{
"code": "sudo vi /mnt/sda1/var/lib/boot2docker/bootlocal.sh",
"language": "shell"
}
]
}
[/block]
This will create a blank bootup script `bootlocal.sh`.
2. Press the **I** key to start editing.
3. Enter the following two lines:
[block:code]
{
"codes": [
{
"code": "mkdir -p /mnt/usb\nmount -t vboxsf -o defaults,uid=`id -u docker`,gid=`id -g docker` usbdrive /mnt/usb",
"language": "shell"
}
]
}
[/block]
4. Press **Esc** on the keyboard.
5. Type `:x` and press **Enter**.
The bootup script is now saved. The `usbdrive` shared folder will be mounted automatically every time the **default** virtual machine is started.
<a name="stepthree" style="text-decoration: none; color: #474a54;">**3. Mount the USB drive mount point in Docker**</a>
1. Launch a Docker container, and use the `-v` flag to mount the `/mnt/usb` directory from the default virtual machine as `/opt/usb` in the container:
[block:code]
{
"codes": [
{
"code": "docker run -i -t -v /mnt/usb:/opt/usb ubuntu /bin/bash",
"language": "shell"
}
]
}
[/block]
The -v argument is used in the following format: `-v <local_path>:<container_path>`.
2. You can easily verify that the mount has been performed correctly using `ls`:
[block:code]
{
"codes": [
{
"code": "ls /opt/usb",
"language": "shell"
}
]
}
[/block]
If all steps have been performed correctly, you should be able to see the contents of your USB drive from the Docker container.
## Mount the USB drive in a Docker container on a Windows host with Docker for Windows
If you are using Docker for Windows, proceed as follows:
1. Right-click the Docker icon <img src="https://files.readme.io/0f79774-docker_for_mac_icon_win.png"
height="22px" width="auto" align="inline" style="margin:1px"/> in system tray and select **Settings**.
2. Select the **Shared Drives** tab on the left.
You will now see a list of drives on your computer.
3. Click the box in the **Shared** column next to the drive you want to mount in your Docker container.
4. If prompted, enter your Windows credentials. You can click the **Remember me** box and allow Docker to store your credentials for future use.
[block:callout]
{
"type": "warning",
"body": "The account used to authenticate with your **Shared Drives** needs to be the same as the one used to run docker commands. Otherwise, you will not be able to access the shared drive from your container. Also, for security reasons you will not be able to use an account that doesn't have a defined password."
}
[/block]
5. Click **OK**.
Once this procedure has been completed, open Windows PowerShell and enter the following command:
[block:code]
{
"codes": [
{
"code": "docker run -ti -v d:/:/data ubuntu /bin/bash",
"language": "shell"
}
]
}
[/block]
The `-v` argument is used in the following format: `-v <local_path>:<container_path>`. In this case, make sure to replace `d:/` with the actual letter of your USB drive on the local machine.
To verify that the drive has been properly mounted inside the container, enter:
[block:code]
{
"codes": [
{
"code": "ls /data",
"language": "shell"
}
]
}
[/block]
You will now see a list of files and directories on your USB drive.