# Percona for MongoDB Docker with Secrets

**URL:** <https://forums.percona.com/t/percona-for-mongodb-docker-with-secrets/20375>\
**Category:** Percona Server for MongoDB\
**Tags:** mongodb, closed-no-reply\
**Created:** [March 1, 2023, 10:31pm UTC](https://forums.percona.com/t/percona-for-mongodb-docker-with-secrets/20375 "2023-03-01T22:31:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![markvo77](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@markvo77](https://forums.percona.com/u/markvo77)\
**Post date:** [March 1, 2023, 10:31pm UTC](https://forums.percona.com/t/percona-for-mongodb-docker-with-secrets/20375/1 "2023-03-01T22:31:00Z")

</div>

I’m attempting to create a Percona for MongoDB container with Docker compose. I want to use [secrets](https://github.com/compose-spec/compose-spec/blob/master/spec.md#secrets-top-level-element) and looking through the [Percona Dockerfiles](https://github.com/percona/percona-docker) 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:

```auto
Error response from daemon: getent unable to find entry "1001" in passwd database

```

The compose file is simply:

```auto
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
