Weird permissions podman docker-compose volume

3.4k views Asked by At

I have specified docker-compose.yml file with some volumes to mount. Here is example:

backend-move:
container_name: backend-move
environment:
  APP_ENV: prod
image: backend-move:latest
logging:
  options:
    max-size: 250m
ports:
- 8080:8080
tty: true
volumes:
- php_static_logos:/app/public/images/logos
- ./volumes/nginx-php/robots.txt:/var/www/html/public/robots.txt
- ./volumes/backend/mysql:/app/mysql
- ./volumes/backend/httpd/welcome.conf:/etc/httpd/conf.d/welcome.conf

After I run podman-compose up -d and go to container through docker exec -it backend-move bash

I have this crazy permissions (??????????) on mounted files:

bash-4.4$ ls -la
ls: cannot access 'welcome.conf': Permission denied
total 28
drwxrwxrwx. 2 root root  114 Apr 21 12:29 .
drwxrwxrwx. 5 root root  105 Apr 21 12:29 ..
-rwxrwxrwx. 1 root root  400 Mar 21 17:33 README
-rwxrwxrwx. 1 root root 2926 Mar 21 17:33 autoindex.conf
-rwxrwxrwx. 1 root root 1517 Apr 21 12:29 php.conf
-rwxrwxrwx. 1 root root 8712 Apr 21 12:29 ssl.conf
-rwxrwxrwx. 1 root root 1252 Mar 21 17:27 userdir.conf
-?????????? ? ?    ?       ?            ? welcome.conf

Any suggestions?

[root@45 /]# podman-compose --version
['podman', '--version', '']
using podman version: 3.4.2
podman-composer version  1.0.3
podman --version
podman version 3.4.2
1

There are 1 answers

0
Idris On BEST ANSWER

facing the exact same issue, although on macos with the podman machine, since the parent dir has been mounted on the podman-machine, I do get the write permissions.

Although, on linux, it just fails as in your example.

To fix my issue, I had to add:

privileged: true