I’m attempting to create a Percona for MongoDB container with Docker compose. I want to use secrets and looking through the Percona Dockerfiles I see that specifying the _FILE
suffix of a variable allows this just like the regular mongo image.
However, if I launch the percona image with a secret added to the service (regardless of any other settings), it fails to launch and gives me this error:
Error response from daemon: getent unable to find entry "1001" in passwd database
The compose file is simply:
version: '3.9'
services:
settings_db:
image: percona/percona-server-mongodb:6.0.4-3
container_name: test_percona
secrets:
- source: mongo_auth
target: mongo_auth
secrets:
mongo_auth:
environment: SETTINGS_DB_PASSWORD
Every combination of changing the user
, uid
and gid
on the secret or the service seem to have no effect (changing the user
alters the error to say what you set instead of 1001
).
Recently, I discovered that this is directly caused by using environment
on the secret. If I use file
instead, then this error does not occur. However, I am looking to use environment variables to inject the password from a common .env file.
Has anyone seen this issue before? I appreciate any insight