How can I mount an external USB drive in a docker container?

I created a Ubuntu container with this command

docker run -it --entrypoint "/bin/bash" ubuntu:latest

I can't seem to mount an external USB drive. This works under the host machine, so no issue with the drive. When I try it in the container, I get

$ sudo mount /dev/sda1 /mnt/usb
mount: /mnt/usb: permission denied.
root@048939b7b3e3:/# mount /dev/sda1 /mnt/usb
mount: /mnt/usb: permission denied.

I wouldn't know why I don't have the permissions to mount. According to this tutorial, it should work just like on the host system.

2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like