https://prefect.io logo
f

Florentino Bexiga

02/18/2022, 6:44 PM
hello everyone! any chance that it is possible to use the DockerRun run_config with basic auth credentials?
k

Kevin Kho

02/18/2022, 7:02 PM
Hi @Florentino Bexiga, do you mean you have Flow running and need to authenticate to pull an image from somewhere/
f

Florentino Bexiga

02/18/2022, 7:11 PM
yes
locally DockerRun works fine, but now I want to pull the image from somewhere else and I haven't been able to find exactly how
k

Kevin Kho

02/18/2022, 7:19 PM
You need to log-in on the agent side. Where is your image hosted? AWS?
f

Florentino Bexiga

02/18/2022, 7:27 PM
yes
k

Kevin Kho

02/18/2022, 7:28 PM
How did you authenticate to push the image there?
f

Florentino Bexiga

02/18/2022, 7:31 PM
i have a setup with github actions that authenticates on ECR, builds the agent with a custom image, pushes, runs the register to build and push the flow image as well then i run the container for the agent but i get what you are saying, basically the container of the agent should run docker login prior to running the prefect agent, correct?
k

Kevin Kho

02/18/2022, 7:32 PM
Yeah exactly. This may help you. Look for the credential-helper part
f

Florentino Bexiga

02/18/2022, 7:33 PM
i've used this before in this case i was trying to pass credentials as an env var to the agent and make it use them somehow didn't occur to me to just do the docker login beforehand
thanks!
k

Kevin Kho

02/18/2022, 7:34 PM
ah perfect then!
f

Florentino Bexiga

02/18/2022, 7:38 PM
still... prefect agent uses the docker REST API instead of the docker utility if i just do "docker login", the agent won't pick those credentials up will it?
k

Kevin Kho

02/18/2022, 7:40 PM
I believe it does. Did you push an image yourself or with Prefect
DockerStorage
?
f

Florentino Bexiga

02/18/2022, 7:41 PM
DockerStorage
k

Kevin Kho

02/18/2022, 7:41 PM
Then the push succeeded using the API right? If I’m understanding the question right
f

Florentino Bexiga

02/18/2022, 7:42 PM
true, so the pull should too, good point