why doesn't chown work in Dockerfile?

后端 未结 5 700
日久生厌
日久生厌 2020-12-02 10:44

My Dockerfile creates a directory, chown\'s it, and then lists the directory afterwards. The directory is still owned by root. Why is that?

Here is the Dockerfile:

5条回答
  •  青春惊慌失措
    2020-12-02 11:29

    For Alpine Linux users, I had to do chown -R root . in the workspace I was trying to own. This had to be done in the CMD of the dockerfile, as I believe the volume mounts may overwrite files when mounting

提交回复
热议问题