Docker Community Forums

Share and learn in the Docker community.

Dockerfile RUN chown does not work.in toolbox


(Davidlandry) #1

I created my own simple image from centos:6 - all I did was add a user with a password.

I can run the image in a container on both Linux (RHEL 7) and Windows 7 (docker toolbox)

using a Dockerfile I do the following (ADD a tgz file that expands over the user home directory to add their desktop/environemt/etc files.)

Then I ‘RUN chown -Rh myuser:myuser /home/myuser’ to set the permissions for the home directory.

Under Linux docker everything works as expected, I can su into the user and read & create files and directories as expected.

Under Docker ToolBox on Windows 7 it’s a total mess. I can’t do anything in the home diretory as I don’t seem to have any permissions. even doing an ‘ls -la’ gives me a directory listing that looks like all the own/permission fields are corrupted (all ??? marks all over the place.)


so essentially I just create an image pulling centos:6
run it and create a user ‘myuser’ and give it a password
I them commit the container to image 'v1’
I then run the following Dockerfile to create a new image with files in ‘myuser’ home directory and change the ownership

============
FROM v1
MAINTAINER David Landry dlandry@ca.ibm.com

ADD myuser.tgz /home/
RUN chown -Rh myuser.myuser /home/myuser

Why does this work under Linux but not under Windows 7/Docker Toolbox?

Edited to add: Docker Toolbox 1.10 and Linux is 1.8.2

Tried doing the chown as root in a running container (Windows toolbox) and while the permissions seemed to change, and as ‘myuser’ an ‘ls -la’ looked like it should, I still could not do anythin as ‘myuser’