Docker Community Forums

Share and learn in the Docker community.

Bind mounted file losing permissions once file is edited


(Rijnhard) #1

Take the following Compose file snippet

services:
    test:
         image: centos:7
         volumes:
              - ../config/what/ever.conf:/etc/something/ever.conf:rw

If I edit the local file ../config/what/ever.conf on my host, and then exec into the container and do an ll -al /etc/something/ I get this:

-?????????  ? ?    ?        ?            ? ever.conf

Prior to editing it was this:

-rwxrwxrwx  1 root root  8129 Mar  20  18:35 ever.conf

restarting the container and its back to normal.

I have other environments that bind mount full code directories that I edit locally and there’s no issues so this is a bit puzzling,