Moving a file (with encrypted token) after building a docker on Jenkins
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
.sentrylircthat 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?
Bogopo last edited by
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.