From 5a6825705de7149b5a637984b861667404e92a53 Mon Sep 17 00:00:00 2001 From: Mauro Date: Fri, 14 Oct 2016 10:27:45 -0300 Subject: [PATCH 1/2] Access to devices --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 4c49f93..21451e7 100644 --- a/README.md +++ b/README.md @@ -698,6 +698,21 @@ For all containers listed by image: docker ps -a -f ancestor=ubuntu ``` +Give access to a single device: + +``` +docker run -t -i --device=/dev/ttyUSB0 debian bash +``` + +Give access to all devices: + +``` +docker run -t -i --privileged debian bash +``` +more info about privileged containers [here]( +https://docs.docker.com/engine/reference/run/#/runtime-privilege-and-linux-capabilities) + + ## Contributing Here's how to contribute to this cheat sheet. From ae49fa19d9738c5d9dce236b836051b6ae0b3406 Mon Sep 17 00:00:00 2001 From: Mauro Date: Sat, 15 Oct 2016 13:58:44 -0300 Subject: [PATCH 2/2] Moved access to devices to a more appropiate section --- README.md | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 21451e7..7dcb490 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,22 @@ To mount a FUSE based filesystem, you need to combine both --cap-add and --devic docker run --rm -it --cap-add SYS_ADMIN --device /dev/fuse sshfs ``` +Give access to a single device: + +``` +docker run -it --device=/dev/ttyUSB0 debian bash +``` + +Give access to all devices: + +``` +docker run -it --privileged -v /dev/bus/usb:/dev/bus/usb debian bash +``` + +more info about privileged containers [here]( +https://docs.docker.com/engine/reference/run/#/runtime-privilege-and-linux-capabilities) + + ### Info * [`docker ps`](https://docs.docker.com/engine/reference/commandline/ps) shows running containers. @@ -698,20 +714,6 @@ For all containers listed by image: docker ps -a -f ancestor=ubuntu ``` -Give access to a single device: - -``` -docker run -t -i --device=/dev/ttyUSB0 debian bash -``` - -Give access to all devices: - -``` -docker run -t -i --privileged debian bash -``` -more info about privileged containers [here]( -https://docs.docker.com/engine/reference/run/#/runtime-privilege-and-linux-capabilities) - ## Contributing