Docker容器无法运行

时间:2016-03-06 01:34:29

标签: linux docker

[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...

1 个答案:

答案 0 :(得分:0)

看起来您按照sharelatex网站上的说明通过docker run -v将主机文件夹挂载到图像。

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

解决方案1:您需要找到Docker容器用户的uid,并在主机chown上找到具有相同uid的用户的已安装文件夹。

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