Specify "privileged" container mode in dockerfile?
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 ?
Related videos on Youtube
A. Smith
Updated on June 04, 2022Comments
-
A. Smith almost 2 years
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?
-
A. Smith over 5 yearsI 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: github.com/globocom/bird-routing
-
Truong Dang over 5 years@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
-
A. Smith over 5 yearsYes 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.
-
Truong Dang over 5 yearsYou can call Docker API with curl. I think you can add that curl command in your bash script file..
-
A. Smith over 5 yearsCould you give me a sample of that? For example, if I wanted to build ubuntu container with "privileged status.
-
Truong Dang over 5 years@A.Smith here you can find example that how you can call docker api to creat container with curl docs.docker.com/develop/sdk/examples
-
Truong Dang over 5 yearsAnd here is params that you can set to curl command. Notice to
HostConfig
for setPrivileged
istrue
-
Truong Dang over 5 years@A.Smith Here is what you need. gist.github.com/dangminhtruong/5c95ebe220584d3e0429c05549b98175