[GH-ISSUE #140] Documentation update for Docker --cap-add flag #98

Closed
opened 2026-03-01 15:40:29 +03:00 by kerem · 6 comments
Owner

Originally created by @j7an on GitHub (Jan 22, 2019).
Original GitHub issue: https://github.com/budtmo/docker-android/issues/140

Operating System:
Linux host

The current --privileged flag is giving full access to the host. Could someone update the documentation with --cap-add flag for the actual host privileges needed to run the images for this repo? This will limit any security vulnerabilities that might exist within the image.

Originally created by @j7an on GitHub (Jan 22, 2019). Original GitHub issue: https://github.com/budtmo/docker-android/issues/140 Operating System: Linux host The current `--privileged` flag is giving full access to the host. Could someone update the documentation with `--cap-add` flag for the actual host privileges needed to run the images for this repo? This will limit any security vulnerabilities that might exist within the image.
kerem 2026-03-01 15:40:29 +03:00
Author
Owner

@budtmo commented on GitHub (Jan 24, 2019):

Hi @j7an ,

It would be great if you could help us with it and create a PR.

<!-- gh-comment-id:457115175 --> @budtmo commented on GitHub (Jan 24, 2019): Hi @j7an , It would be great if you could help us with it and create a PR.
Author
Owner

@malletjo commented on GitHub (Mar 29, 2019):

fyi, you can use --cap-add=SYS_ADMIN --device=/dev/bus/usb.

<!-- gh-comment-id:478181481 --> @malletjo commented on GitHub (Mar 29, 2019): fyi, you can use ```--cap-add=SYS_ADMIN --device=/dev/bus/usb```.
Author
Owner

@budtmo commented on GitHub (Apr 2, 2019):

Hi @malletjo ,

could you update documentation and create a PR?

<!-- gh-comment-id:478948567 --> @budtmo commented on GitHub (Apr 2, 2019): Hi @malletjo , could you update documentation and create a PR?
Author
Owner

@j7an commented on GitHub (Apr 3, 2019):

@malletjo It looks like --cap-add=SYS_ADMIN is same as giving root access based on CAP_SYS_ADMIN: the new root. Are there other ones we can use as alternative?

<!-- gh-comment-id:479600468 --> @j7an commented on GitHub (Apr 3, 2019): @malletjo It looks like `--cap-add=SYS_ADMIN` is same as giving root access based on [CAP_SYS_ADMIN: the new root](https://lwn.net/Articles/486306/). Are there other ones we can use as alternative?
Author
Owner

@HasBert commented on GitHub (May 9, 2019):

I also tried to not use the privileged mode and replace it with --cap-add=SYS_ADMIN, with --cap-add=NET_ADMIN, with --cap-add=SYS_MODULE and as @malletjo noted with --cap-add=SYS_ADMIN --device=/dev/bus/usb nothing worked for me. I'm not using a real device. Here is the official documentation of --cap-add.

Maybe it has something to do with the HAXM and KVM which are needed for virtualization and are only available on the host? Correct me if I'm wrong.
Is there a place inside the docker container where the logs of the startup process are stored? I'd love to help, but I think I'm not quite as deep in this topic than you are.

<!-- gh-comment-id:490708451 --> @HasBert commented on GitHub (May 9, 2019): I also tried to not use the privileged mode and replace it with `--cap-add=SYS_ADMIN`, with `--cap-add=NET_ADMIN`, with `--cap-add=SYS_MODULE` and as @malletjo noted with `--cap-add=SYS_ADMIN --device=/dev/bus/usb` nothing worked for me. I'm not using a real device. [Here is the official documentation of --cap-add](https://docs.docker.com/engine/reference/run/). Maybe it has something to do with the HAXM and KVM which are needed for virtualization and are only available on the host? **Correct me if I'm wrong.** Is there a place inside the docker container where the logs of the startup process are stored? I'd love to help, but I think I'm not quite as deep in this topic than you are.
Author
Owner

@budtmo commented on GitHub (May 9, 2023):

--privileged tag is not needed anymore. Please check the current documentation to run docker-android.

<!-- gh-comment-id:1540744695 --> @budtmo commented on GitHub (May 9, 2023): --privileged tag is not needed anymore. Please check the current documentation to run docker-android.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-android#98
No description provided.