a GIT_TOKEN which I need to have it when building a dockerfile
Of course I can use github secrets for this purpose, But I want to build it on my pc or servers as well
the GIT_TOKEN must be set inside an ENV when images is being built, so I can not put it inside docker-compose
What is the best way?
Here's y
Why would you want to have your secret inside of your container image? Never do that! Instead have your secrets in your environment. Your container host for example and mount them to the container via env variables.
Look, The image will be built this way: It clones a git repo and build an image to run the code, Since the repo is private, I need a git token and since I want to make it automate in ci, So I need to put secret somewhere What do you suggest?
If you are using gitlab or github you can set secrets on repo settings and put in ci yml file
Do you mean that during your Docker build process you need to clone another private Repo to your project and start building them, so it will become some kind of sub module in your root repo. If no, there is no reason to store your git token as "Build time" envrionment variable in your Dockerfile, instead you should get your GIT token from some secrets manager and clone your repo, and then build
Yes I need to clone private repos during the dockerbuild What is the best way to pretect secrets? maybe I need to build it without ci
People give you answers already
Обсуждают сегодня