I am a little new to Docker technology, however, I would like to deploy a couple of BGP BIRD containers throughout my infrastructure. I would like to automate container creation with Dockerfile builds, however, I can not run BIRD in docker without giving the container "privileged" mode. There doesn't appear to be a Dockerfile version for getting "privileged" mode. Are there workarounds or perhaps I am missing the point?
Asked
Active
Viewed 1.7k times
3 Answers
5
You can't give privileged
mode in Dockerfile. You can only run by --privileged
when start docker by command line.
There is one other way, that you can try start you docker container via Docker API
And set request param for auto run with privileged
mode.
As I know, normal case you need to run docker in privileged
mode is you wanna run docker in docker. What BIRD container is ?

Truong Dang
- 3,119
- 1
- 15
- 21
-
I would love to not use "privileged" mode, but BIRD software requires it and will not run without it. BIRD is used for BGP routing and is quite popular between network administrators. Here is a sample project on github by someone using BIRD: https://github.com/globocom/bird-routing – A. Smith Nov 28 '18 at 14:00
-
@A.Smith And you can't start container by you hand, it must be automatic ? In this case, I think create a tool start container by call Docker APi is possible – Truong Dang Nov 28 '18 at 14:11
-
Yes I can, but then I have to involve bash scripts for my automation + i'd like to deploy other non BIRD containers using the same Dockerfile. – A. Smith Nov 28 '18 at 14:14
-
You can call Docker API with curl. I think you can add that curl command in your bash script file.. – Truong Dang Nov 28 '18 at 14:17
-
Could you give me a sample of that? For example, if I wanted to build ubuntu container with "privileged status. – A. Smith Nov 28 '18 at 14:21
-
@A.Smith here you can find example that how you can call docker api to creat container with curl https://docs.docker.com/develop/sdk/examples/ – Truong Dang Nov 28 '18 at 14:29
-
And here is params that you can set to curl command. Notice to `HostConfig` for set `Privileged` is `true` – Truong Dang Nov 28 '18 at 14:31
-
@A.Smith Here is what you need. https://gist.github.com/dangminhtruong/5c95ebe220584d3e0429c05549b98175 – Truong Dang Nov 28 '18 at 14:53
0
If for any reason you cannot give arguments in CLI and knowing that --priviledged
is mostly full container capabilities
then try docker compose maybe:
cap_add:
- ALL
or list them all

Sławomir Lenart
- 7,543
- 4
- 45
- 61