Access named volume from container when not running as root?

戏子无情 提交于 2019-12-04 13:47:17

The following works: In the Dockerfile, install sudo and add user to the sudo group, requiring a password:

RUN apt-get update
RUN apt-get -y install sudo
RUN echo "user:SECRET" | chpasswd && adduser user sudo

Then, in the Docker Compose config, the command will be:

bash -c "echo SECRET | sudo -S chown user:user /flower; celery -A proj flower --power=5555 --persistent --db=/flower/flower"

I'm not sure if this is the best way, though, or what the security implications of this are.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!