Home  >  Q&A  >  body text

docker 加载 volumes 的问题?

#执行
sudo docker run -d -p 81:80 -v /root/php:/root/php --name <tag> image-name

启动镜像 Mount container volumes 的时候在logs里看到

chown: /var/www/html: Permission denied

请问这个要怎么解决?查了查帖子说是要修改uid,可是怎么容器里root和主机的root,uid都是0呀~

#查询方法
id root
PHP中文网PHP中文网2755 days ago969

reply all(3)I'll reply

  • 某草草

    某草草2017-04-27 09:03:35

    I have successfully configured shared volumes using this tutorial, which is available for reference.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-27 09:03:35

    chmod 777 /var/www/html

    reply
    0
  • 習慣沉默

    習慣沉默2017-04-27 09:03:35

    Check if selinux is turned off.
    I mounted the host directory into the mysql container, but it failed after a few days. After turning off selinux, it succeeded.

    reply
    0
  • Cancelreply