You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Default value [Author's note: the value of owner UID or GID] is USER running container.
The default value [Author's note: the value of permissions] is world-readable permissions (mode 0444).
However, file was mounted in /run/secrets/ saves ownership and permission mode from host filesystem.
Steps To Reproduce
Initial State
project folder
$ ls -l
total 8
-rw-r--r-- 1 hostuser hostuser 170 Dec 9 10:00 docker-compose.yaml
-rw------- 1 hostuser hostuser 17 Dec 9 09:51 secret.txt
docker-compose.yaml
services:
app:
image: alpine:3.14user: root:root # did not necessarily, just for claritycommand: ls -l /run/secrets/secret # output of this command demonstrate the issuesecrets:
- secretsecrets:
secret:
file: ./secret.txt
Current user
$ id
uid=1000(hostuser) gid=1000(hostuser) groups=1000(hostuser),27(sudo),100(hostuser),109(docker)
Reproduction issue
$ docker compose up
[+] Running 1/0
✔ Container docker-secrets-app-1 Created 0.0s
Attaching to app-1
app-1 | -rw------- 1 1000 1000 17 Dec 9 08:51 /run/secrets/secret
app-1 exited with code 0
Description
According to the documentation:
However, file was mounted in
/run/secrets/
saves ownership and permission mode from host filesystem.Steps To Reproduce
Initial State
docker-compose.yaml
Reproduction issue
$ docker compose up [+] Running 1/0 ✔ Container docker-secrets-app-1 Created 0.0s Attaching to app-1 app-1 | -rw------- 1 1000 1000 17 Dec 9 08:51 /run/secrets/secret app-1 exited with code 0
Conclusion
app-1 | -r--r--r-- 1 root root 17 Dec 9 08:51 /run/secrets/secret
app-1 | -rw------- 1 1000 1000 17 Dec 9 08:51 /run/secrets/secret
Compose Version
Docker Environment
Anything else?
If you run
docker compose up
as root, the same result will be obtained.The text was updated successfully, but these errors were encountered: