# VSCode Container Support

**URL:** <https://community.doppler.com/t/vscode-container-support/104>\
**Category:** Feature Requests\
**Created:** [February 12, 2021, 12:12am UTC](https://community.doppler.com/t/vscode-container-support/104 "2021-02-12T00:12:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![snpranav](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@snpranav](https://community.doppler.com/u/snpranav)\
**Post date:** [February 12, 2021, 12:12am UTC](https://community.doppler.com/t/vscode-container-support/104/1 "2021-02-12T00:12:48Z")

</div>

I’m not sure how many people face this issue, but I use VSCode containers or docker containers to develop applications and write scripts for environment isolation. Up until now, I’ve been installing Doppler while building the docker image or installing it once the container is launched. However, I can’t store credentials every time I log in or use a doppler token. Thus, once the container is destroyed, the credentials are removed. Is there a way to mount a volume to store the doppler token / credentials on my host machine?  
If so what path would I need to mount on my host machine?

Additionally, can Doppler release a VSCode extension to manage projects from the IDE itself?

---

<div class="post-metadata">

**Author:** ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)\
**Post date:** [February 12, 2021, 12:46am UTC](https://community.doppler.com/t/vscode-container-support/104/2 "2021-02-12T00:46:17Z")

</div>

Hi Pranav and welcome to the Doppler community!

While we don’t have official docs for VS Code yet (which I will start working on shortly), here are some tips for making it as easy as possible to work with.

**Step 1.** Edit your devcontainer.json file to add a `containerEnv` field:

```auto
{
...
    "containerEnv": {
        "DOPPLER_TOKEN": "${localEnv:DOPPLER_TOKEN}"
    },
...
}

```

**Step 2.** Exit VS Code

**Step 3.** Launch VS code from the terminal with the `DOPPLER_TOKEN` env var is set:

```auto
DOPPLER_TOKEN=$(doppler configure get token --plain) code ~/your-project-here

```

**Step 4.** VS Code should pick-up that you’ve changed the `devcontainer.json` and should offer to rebuild it, which you need to do.

**Step 5.** Now with the dev container rebuilt, you should now have the `$DOPPLER_TOKEN` set inside the container and can use `doppler run` like you would normally.

If launching VS Code using the `DOPPLER_TOKEN=$(doppler configure get token --plain) code ~/your-project-here` approach is a bit kludgy, here is another option which exposes the Doppler CLI token without needing to launch VS Code from the terminal.

**Step 1.** Expose your Doppler CLI (personal) token in your `.bashrc` or `.bash_profile`. We name this `DOPPLER_CLI_TOKEN` so it doesn’t affect Doppler in your local development environment.

```auto
export DOPPLER_CLI_TOKEN=$(doppler configure get token --plain) 

```

**Step 2.** Edit your `devcontainer.json` file to add a `containerEnv` field, mapping `DOPPLER_TOKEN` to the `DOPPLER_CLI_TOKEN` :

```auto
{
...
    "containerEnv": {
        "DOPPLER_TOKEN": "${localEnv:DOPPLER_CLI_TOKEN}"
    },
...
}

```

Let me know how this works out for you.
