For a specific task, I am failing to scan BLE / BlueZ (hcitool, gatttool, btdevice-l) in Docker under non-privileged and Non-Host network mode.

These are my results (in Debian-Jessie-8.8.0 Host and debian:jessie docker image):

 root1@73ab53a9268e:/# hciconfig -a
 Can't open HCI socket.: Operation not permitted

 root1@73ab53a9268e:/# bt-device -l
 Couldn't connect to DBus system bus: Could not connect: Connection refused

On another image:

root2@0d208802d44a:/# hciconfig -a
Can't open HCI socket.: Address family not supported by protocol

I even gave ALL-CAP permissions for Docker on Host but still could not make it.

docker run --name container-ID --cap-add=ALL -d -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro Image-ID

So, is it possible by any chance to scan BLE / BlueZ in docker under Non-Privileged & Non-Host network mode?


Half Success:

With help from Docker Community, I have successfully started DBus Service inside Docker container by logging in Docker as follows :

docker run -v /opt/bluetooth:/var/lib/bluetooth -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /tmp/$(mktemp -d):/run -it debian:jessie

Just looking to start Bluetooth service next... If somebody got any clue, that would be helpful.

  • Why did you use so many backticks, breaking your command line into multiple strings? – G-Man Nov 18 '17 at 3:49

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.