Running containers use root
as the logged in user. This is fine, but in times like you run method like npm init
and bower init
,
this will be cumbersome. This commands generate json configuration files for development. And when you try to edit this files in your host machine,
you will notice that you may have Permission denied
errors and you should run first chown
command to give you permission on these created files.
Fortunately, we have a solution for this, by creating our own user inside the docker container.
In this example, let's say we created a container for our calculator
angular app by using this command: