更新时间:2023-11-24 20:36:04
我毕竟设法对卷进行了chown/chgrp-我的错误是它不能在容器内工作(没有sudo)-但它可以工作从外部使用docker exec,指定root用户:
I managed to chown/chgrp the volume after all - my mistake was that it does not work from within the container (there is no sudo) - but it works from outside using docker exec, specifying the root user:
docker exec -u 0 -it backend_app chown cnb /var/mypath
docker exec -u 0 -it backend_app chgrp cnb /var/mypath
用户@Stuck还通过创建另一个docker-image层提出了一种更精细的方法:可以`bootBuildImage`创建可写卷?
User @Stuck also suggested a more elaborate approach by creating another docker-image layer: can `bootBuildImage` create writeable volumes?
Spring的Andy Wilkinson指出,这是Docker的一个普遍问题-因此,如果将来出现其他解决方案,我很高兴对此问题进行更新.
Andy Wilkinson from Spring pointed out that this is a general Docker issue - so if some other solution pops up in the future, I'm glad to update this question.