gpt4 book ai didi

linux - Docker 容器无法运行

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:25:30 24 4
gpt4 key购买 nike

[frankchen@localhost ~]$ docker start sharelatex 
sharelatex
[frankchen@localhost ~]$ docker logs sharelatex
*** Running /etc/my_init.d/00_make_sharelatex_data_dirs.sh...
mkdir: cannot create directory ‘/var/lib/sharelatex/data’: Permission denied
chown: cannot access ‘/var/lib/sharelatex/data’: No such file or directory
mkdir: cannot create directory ‘/var/lib/sharelatex/data’: Permission denied
chown: cannot access ‘/var/lib/sharelatex/data/user_files’: No such file or directory
mkdir: cannot create directory ‘/var/lib/sharelatex/data’: Permission denied
chown: cannot access ‘/var/lib/sharelatex/data/compiles’: No such file or directory
mkdir: cannot create directory ‘/var/lib/sharelatex/data’: Permission denied
chown: cannot access ‘/var/lib/sharelatex/data/cache’: No such file or directory
mkdir: cannot create directory ‘/var/lib/sharelatex/tmp’: Permission denied
chown: cannot access ‘/var/lib/sharelatex/tmp’: No such file or directory
mkdir: cannot create directory ‘/var/lib/sharelatex/tmp’: Permission denied
chown: cannot access ‘/var/lib/sharelatex/tmp/uploads’: No such file or directory
mkdir: cannot create directory ‘/var/lib/sharelatex/tmp’: Permission denied
chown: cannot access ‘/var/lib/sharelatex/tmp/dumpFolder’: No such file or directory
*** /etc/my_init.d/00_make_sharelatex_data_dirs.sh failed with status 1

*** Killing all processes...

最佳答案

您似乎按照 sharelatex 网站上的说明通过 docker run -v 将主机文件夹安装到镜像。

当拥有主机文件夹的用户与 Docker 容器用户的 uid 不同时,您将遇到 Docker 用户无法写入挂载文件夹的权限问题。

方案一:需要找出Docker容器用户的uid,在主机上chown挂载的文件夹给一个具有相同uid的用户。

解决方案 2:或者,您可以在没有挂载文件夹的情况下运行 docker 镜像。在这种情况下,您的数据存储在容器内,如果删除容器,您需要确保先备份数据。

关于linux - Docker 容器无法运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35822054/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com