Skip to content

empty VOLUME is very restricted: root:root 700 #2969

@SvenDowideit

Description

@SvenDowideit

Is there really no way to set ownership and permissions of a VOLUME?

~ $ docker build -t test -
FROM ubuntu
RUN mkdir /data ; chmod 777 /data
VOLUME ["/data"]
RUN chmod 755 /data

Uploading context 2048 bytes
Step 1 : FROM ubuntu
 ---> 8dbd9e392a96
Step 2 : RUN mkdir /data ; chmod 777 /data
 ---> Using cache
 ---> 5e2d567c32ef
Step 3 : VOLUME ["/data"]
 ---> Using cache
 ---> d2832c4afd2c
Step 4 : RUN chmod 755 /data
 ---> Running in 34b05587ce60
 ---> 7c4d94ba6eed
Successfully built 7c4d94ba6eed
~ $ docker run -t -i test ls -la /data
total 8
drwx------  2 root root 4096 Nov 30 09:25 .
drwxr-xr-x 37 root root 4096 Nov 30 09:25 ..

I'm making a container which will run something that does not want to run as root, so 700 is particularly frustrating.

somewhat related to #1742 and #2088

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions