This is the part where the user executing the process is changed from root to mongodb thanks to the gosu utility. The following piece of code at the beginning of the file is very interesting. This is the Dockerfile used to build the MongoDB 4.0 image: There is no user with uid 999, that’s the reason why no user name can be mapped to this uid in the previous command. Once in the terminal, let’s run a container based on the MongoDB image: (local) ~ $ docker container run -d -p 27017:27017 -name mongo mongo:4.0 8cce38822a23bbacb5349c5af63c50f1d2e371029f5b6332b1144fcc4f8cb723Īnd check, from the host machine, which user runs the mongod process: (local) ~ $ ps aux | grep mongo 1143 999 0:00 mongod -bind_ip_allįrom the output above, we can see that the user identified by the uid 999 is the one who owns the mongod process. That’s what is called DinD, for Docker in Docker, as the Docker daemon runs itself in a container. Note: Under the hood, you’ll have a shell but in an Alpine container in which the Docker daemon is installed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |