I set up a fresh docker in rootless mode on a Rocky Linux, then migrated all my containers by unziping a backup and just “docker compose up” into each services. But I faced the following error of file permissions “Failed to load/generate certificate: save cert: open /var/syncthing/config/cert.pem: permission denied”.
After oppening a shell into the container, I found that the user with the “UID” and “GUID” 1000 is not present. So it’s logical that I don’t have the permission to access the file.
Am I bad at files permissions or is it the container image that is wrongly set up ?
Relevant log output
❯ docker compose up
[+] Running 1/0
✔ Container syncthing Recreated 0.0s
Attaching to syncthing
syncthing | [start] 2024/11/12 20:50:23 INFO: syncthing v1.28.0 "Gold Grasshopper" (go1.23.2 linux-arm64) docker@github.syncthing.net 2024-10-04 19:47:57 UTC [noupgrade]
syncthing | [start] 2024/11/12 20:50:23 INFO: Generating ECDSA key and certificate for syncthing...
syncthing | [start] 2024/11/12 20:50:23 WARNING: Failed to load/generate certificate: save cert: open /var/syncthing/config/cert.pem: permission denied
syncthing | [monitor] 2024/11/12 20:50:23 INFO: Syncthing exited: exit status 1
syncthing | [start] 2024/11/12 20:50:24 INFO: syncthing v1.28.0 "Gold Grasshopper" (go1.23.2 linux-arm64) docker@github.syncthing.net 2024-10-04 19:47:57 UTC [noupgrade]
syncthing | [start] 2024/11/12 20:50:24 INFO: Generating ECDSA key and certificate for syncthing...
syncthing | [start] 2024/11/12 20:50:24 WARNING: Failed to load/generate certificate: save cert: open /var/syncthing/config/cert.pem: permission denied
syncthing | [monitor] 2024/11/12 20:50:24 INFO: Syncthing exited: exit status 1
syncthing | [start] 2024/11/12 20:50:25 INFO: syncthing v1.28.0 "Gold Grasshopper" (go1.23.2 linux-arm64) docker@github.syncthing.net 2024-10-04 19:47:57 UTC [noupgrade]
syncthing | [start] 2024/11/12 20:50:25 INFO: Generating ECDSA key and certificate for syncthing...
syncthing | [start] 2024/11/12 20:50:25 WARNING: Failed to load/generate certificate: save cert: open /var/syncthing/config/cert.pem: permission denied
syncthing | [monitor] 2024/11/12 20:50:25 INFO: Syncthing exited: exit status 1
syncthing | [start] 2024/11/12 20:50:26 INFO: syncthing v1.28.0 "Gold Grasshopper" (go1.23.2 linux-arm64) docker@github.syncthing.net 2024-10-04 19:47:57 UTC [noupgrade]
syncthing | [start] 2024/11/12 20:50:26 INFO: Generating ECDSA key and certificate for syncthing...
syncthing | [start] 2024/11/12 20:50:26 WARNING: Failed to load/generate certificate: save cert: open /var/syncthing/config/cert.pem: permission denied
syncthing | [monitor] 2024/11/12 20:50:26 INFO: Syncthing exited: exit status 1
^CGracefully stopping... (press Ctrl+C again to force)
[+] Stopping 1/1
✔ Container syncthing Stopped 1.7s
canceled