# New secrets added to the Doppler website not being transferred to docker-compose file

**URL:** <https://community.doppler.com/t/new-secrets-added-to-the-doppler-website-not-being-transferred-to-docker-compose-file/1345>\
**Category:** Need Help\
**Tags:** integration\
**Created:** [September 29, 2023, 6:52am UTC](https://community.doppler.com/t/new-secrets-added-to-the-doppler-website-not-being-transferred-to-docker-compose-file/1345 "2023-09-29T06:52:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![someguy](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/someguy/32/914_2.png) [@someguy](https://community.doppler.com/u/someguy)\
**Post date:** [September 29, 2023, 6:52am UTC](https://community.doppler.com/t/new-secrets-added-to-the-doppler-website-not-being-transferred-to-docker-compose-file/1345/1 "2023-09-29T06:52:54Z")

</div>

Hi,

I started using Doppler today and I added several secrets to `prd` and run the sever, they work well.

After that, I added 4 new secrets and they are not being passed to the container (the first group of secrets are being passed, the last 4 added secret are not being passed).

When I run:

```auto
doppler run -- sudo docker-compose up -d 

```

I get:

```auto
WARNING: The NAME_OF_SECRET_ONE variable is not set. Defaulting to a blank string.
WARNING: The NAME_OF_SECRET_TWO variable is not set. Defaulting to a blank string.
WARNING: The NAME_OF_SECRET_THREE variable is not set. Defaulting to a blank string.
WARNING: The NAME_OF_SECRET_FOUR variable is not set. Defaulting to a blank string.

```

The weird thing is that if I run `doppler secrets` I can see the secrets in the server’s console but they are not passed anyway.

I already checked for typos and event tried to set the de secret from the console and the issue persists.

I already tried to

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [September 29, 2023, 3:54pm UTC](https://community.doppler.com/t/new-secrets-added-to-the-doppler-website-not-being-transferred-to-docker-compose-file/1345/2 "2023-09-29T15:54:29Z")

</div>

Hi @someguy!

Welcome to the Doppler Community!

What you’re running into here is that you need to explicitly mention the new variables you want to pass to your containers in your `docker-compose.yml` file as mentioned [here](https://docs.doppler.com/docs/docker-compose#option-1-dockerfile) when you’re executing `docker-compose` as the `doppler run` command like that. An alternate option is to bake the Doppler CLI into your container images and then just pass through the appropriate `DOPPLER_TOKEN` to each container. The image would then execute its process using `doppler run` internally with the access token you pass in. This method is also discussed at the previously linked page!

Let me know if you have any questions!

Regards,  
-Joel

---

<div class="post-metadata">

**Author:** ![someguy](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/someguy/32/914_2.png) [@someguy](https://community.doppler.com/u/someguy)\
**Post date:** [September 29, 2023, 4:09pm UTC](https://community.doppler.com/t/new-secrets-added-to-the-doppler-website-not-being-transferred-to-docker-compose-file/1345/3 "2023-09-29T16:09:19Z")

</div>

Hi Watsonian

> [@watsonian](#):
>
> What you’re running into here is that you need to explicitly mention the new variables you want to pass to your containers in your `docker-compose.yml`

This is the fun part, the new variables are mentioned in the `docker-compose.yaml` file (and I already checked the spelling). In fact, the reason to get the message:

```auto
WARNING: The NAME_OF_SECRET_ONE variable is not set. Defaulting to a blank string.

```

Is because `NAME_OF_SECRET_ONE` is mentioned in the compose file but is not being passed.

> [@watsonian](#):
>
> An alternate option is to bake the Doppler CLI into your container images and then just pass through the appropriate `DOPPLER_TOKEN` to each container.

I’m not a fan of that solution because I have several images in my compose file and don’t want to share secrets between them. IMO, each image should only be aware of their own secrets.

**EDIT:**

O, I saw in the article how to have multiple service with the images solution. Anyway, I still prefer the other solution as that solution wouldn’t alter my current workflow and keeps images lighter. I can change it if there is not alternative but that would be weird. My current setups is supposed to work, I guess.

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [September 29, 2023, 7:23pm UTC](https://community.doppler.com/t/new-secrets-added-to-the-doppler-website-not-being-transferred-to-docker-compose-file/1345/4 "2023-09-29T19:23:01Z")

</div>

@someguy Are you able to paste in your `docker-compose.yml` (redacting anything sensitive)? Also, could you run `doppler secrets --only-names` and paste that here as well (feel free to redact any sensitive names or secrets that aren’t relevant to the issue at hand).

---

<div class="post-metadata">

**Author:** ![rit001](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/rit001/32/382_2.png) [@rit001](https://community.doppler.com/u/rit001)\
**Post date:** [September 30, 2023, 12:33pm UTC](https://community.doppler.com/t/new-secrets-added-to-the-doppler-website-not-being-transferred-to-docker-compose-file/1345/6 "2023-09-30T12:33:52Z")

</div>

doppler run – sudo docker-compose up -d

The issue is the sudo

The Doppler cli is creating an environment in which it injects all the values as environment variables but is then told to sudo the command to be executed and sudo by default creates a new environment to operate in based on the root account. Depending on your environment the following command may work

doppler run – sudo -E docker-compose up -d

Here is the quote from the man page on a Ubuntu system:

```auto
     -E, --preserve-env
                 Indicates to the security policy that the user wishes to preserve their existing environment variables. The security policy may return an error if the user does not have permission to preserve the environment.

```
