Root User Privileges in a Docker Container
Often we will come across situations where the default user setting in docker container will be not be sufficient to perform operations.
Lets say to kill a process, inspect or edit some system files, import certificates or even to install some tool..
We have few options to accomplish this..
Easiest of all:
By default, "0" denotes root user. You can also choose to specify, simply as "root". Also its better to specify the working directory as below..
Other options that are available are during the container image build:
Make necessary file permissions, etc., during the image build in the Docker file
If all the packages are available in your Linux image, chpasswdin the dockerfile before the USER utility
Hope this helps..!!
No comments:
Post a Comment
feedback?