5
为什么chown在Dockerfile中不起作用?
我的Dockerfile创建一个目录,将其chown,然后再列出该目录。该目录仍归root用户所有。这是为什么? 这是Dockerfile: FROM ubuntu:precise RUN useradd -d /home/testuser -m -s /bin/bash testuser RUN mkdir -p /var/local/testrunner/logs VOLUME ["/var/local/testrunner/logs"] RUN grep testuser /etc/passwd RUN grep root /etc/passwd RUN chown -R testuser:testuser /var/local/testrunner/logs RUN ls -ld /var/local/testrunner/logs 这是“ docker build”的输出: Sending build context to Docker daemon 10.24 kB Sending build context to …