<p>You shouldn't bake these kinds of credentials into the docker container. Instead, you should use some kinda secret storage to hold the secret and load it before you start the application.</p>
<p>Basically, when the docker container starts, whatever started the container should securely retrieve the credentials and set it as an environment variable or the container should fetch the secret.</p>

CC BY-SA 4.0
2022-07-18T19:05:38.827Z
2022-07-18T19:05:38.827Z
Levi
<p>I have a project with NextJS and I build it using Jenkins. I run my app inside a docker container, and pull my code from Github.</p>
<p>In my local project, I have a git-ignored file named <code>.sentrylirc</code> that includes my authentication token to Sentry (3rd party monitoring library), which I need to move to the root of my project.</p>
<p>How can I move this file inside my docker container before my build? Where should I store it?</p>

<docker><jenkins>
Moving a file (with encrypted token) after building a docker on Jenkins
TheUnreal
# Moving a file (with encrypted token) after building a docker on Jenkins

(Asked by: username_0 on 2022-05-14)

I have a project with NextJS and I build it using Jenkins. I run my app inside a docker container, and pull my code from Github.

In my local project, I have a git-ignored file named `.sentrylirc` that includes my authentication token to Sentry (3rd party monitoring library), which I need to move to the root of my project.

How can I move this file inside my docker container before my build? Where should I store it?

**Tags:** docker, jenkins


---

## 1 answers

### Answer by username_1 on 2022-07-18. Score: 1

You shouldn't bake these kinds of credentials into the docker container. Instead, you should use some kinda secret storage to hold the secret and load it before you start the application.

Basically, when the docker container starts, whatever started the container should securely retrieve the credentials and set it as an environment variable or the container should fetch the secret.


---

