From 4eaed693435eb4cdd8a16762eb8ac91323ad4921 Mon Sep 17 00:00:00 2001 From: Stefan Seide Date: Sun, 18 Aug 2024 17:49:49 +0200 Subject: [PATCH] docker compose: explicit set user in compose file to prevent permission errors Signed-off-by: Stefan Seide --- README.md | 9 +++++++++ docker-compose.yml | 1 + 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index c76d1fb7..18709eac 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,11 @@ in the output. The config test does not check if hostnames or ip addresses can b More information can be found in the documentation at [docs/configuration.md](docs/configuration.md) and [docs/connections.md](docs/connections.md). +*Remark: Errors on image startup with "permission denied" on config files might be caused due to +wrong runtime users running the image. "docker compose" in recent versions does not pick up the +user defined inside the Dockerfile and uses some other user, therefor it should be explicit set inside +the docker-compose.yml file as shown in the example file.* + ## Environment Variables These environment variables can be used starting Redis Commander as normal @@ -292,8 +297,12 @@ services: - REDIS_HOSTS=local:redis:6379 ports: - "8081:8081" + user: redis ``` +Attention - later version of compose do not honor the "USER" directive from the Dockerfile anymore, +user must be set explicit. Otherwise, "permission denied" errors are shown on startup. + ### Without docker-compose #### Simplest diff --git a/docker-compose.yml b/docker-compose.yml index 39ec9e0c..16510ed9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,3 +16,4 @@ services: - REDIS_HOSTS=local:redis:6379 ports: - "8081:8081" + user: redis