Похожие чаты

How to put secrets in a dcoker image securely? I have

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?

7 ответов

12 просмотров

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.

Ehsan- Автор вопроса
Julian
Why would you want to have your secret inside of y...

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?

Ehsan
Look, The image will be built this way: It clones ...

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

Ehsan- Автор вопроса
Vahagn
Do you mean that during your Docker build process ...

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

Похожие вопросы

Обсуждают сегодня

анрей С какой целью зашёл?
КТ315
35
я часов 15 назад начал пытаться написать хоть что-то напоминающее ос и у меня есть проблема, которую я пытаюсь решить последние часов 5: есть крч 2 исходника с минимальным код...
Al1to
13
Я не очень много работал с потоками, тут возник вопрос - если будет одновременный доступ к памяти из двух разных потоков, это само по себе приведет к ошибке?
The Bird of Hermes
25
Hey @AgentPhalaNetworkBot How many active members are there in this group?
Rahul Sultania
18
а вот интересный вопрос появляется: допустим у нас есть приложение с системой модулей. Будет ли считаться система модуль+прога ассемблерной программой если: а) Прога на Си, м...
Mixail Frolov
29
Foundation controler protected async Task<IActionResult> ExecuteActionAsync<T>(Func<Task<(int statusCode, T result, string message)>> action, string methodName) { var sto...
Jass
6
Друзья всем привет, хочу познакомится с гентой, но пока разнюхиваю обстановку извне. Можете поделится своим опыт насчет поведения генты после обновления всей системы, падала л...
Kupr
18
Yooo, Guys! 🤩 Did you see the latest FunToken stats? We're on fire! 🔥
SpaceGemz
33
Привет. Почему может RabbitMQ через эндпойнт :15692/metrics/detailed?family=queue_metrics не выдавать метрик по конкретной очереди (выдавать нули)? кластер кроля в кубере сост...
Vlad
4
Падает сервис в одной из 100500 инсталляций. По крашрепорту - на System.InitUnits, пересмотрел секции инициализации - ничего криминального не нашел. Модулей - сотни... как бы ...
Михаил Усков
9
Карта сайта