https://prefect.io logo
Title
t

Timo

08/31/2022, 11:31 AM
Hi there, did anyone get a Docker infrastructure with a private Docker registry in 2.3.0 to work? I defined a "Docker Registry" and a "Docker Container" block and used the Docker Container block as infrastructure block in the deployment.
prefect deployment build myflow.py:myflow \
--path /prefect/flows/myflow \
-ib docker-container/dev-image \
--name local_docker \
--skip-upload \
--apply
After running the deployment it breaks with "no basic auth credentials". Inspecting the "Docker Container" block shows that it should use the defined registry block. Double checked the credentials multiple times and successfully logged in with
docker login...
I tried the same on 2.2.0 with the same error after executing the deployment :-(
1
👀 1
a

Anna Geller

08/31/2022, 12:34 PM
Are you asking for a private DockerHub registry?
t

Timo

08/31/2022, 12:34 PM
No, selfhosted registry within our network. But this shouldn't make any difference because we can specify the url , right?
a

Anna Geller

08/31/2022, 12:38 PM
for public images, you could set it on the infra block without using
DockerRegistry
block:
prefect deployment build flows/healthcheck.py:healthcheck \
-n dockerhub -q prod --infra docker-container \
--override image=annaprefect/dataflowops:latest \
--apply
you're correct that for private registries setting auth there and setting URL to repo/image:tag should work if not, this deserves a GitHub issue with MRE (Minimal Reproducible Example)
t

Timo

08/31/2022, 12:39 PM
Ok. I will open a issue with MRE
thanks
a

Anna Geller

08/31/2022, 12:39 PM
just saw that I can have 1 private image on Dockerhub so I should be able to reproduce soon
❤️ 1
I was able to reproduce it - do you already have an issue? I'd add my info then, otherwise I'll create the issue myself, LMK
👍 1
t

Timo

08/31/2022, 12:55 PM
No, I didn't opened one. Waited for your feedback
a

Anna Geller

08/31/2022, 12:56 PM
ok, let me create it then and I will link here and you can add more info
t

Timo

08/31/2022, 12:56 PM
Great, thanks
a

Anna Geller

08/31/2022, 1:11 PM
c

chicago-joe

09/27/2022, 7:16 AM
@Anna Geller what about doing this with an ECSTask? For example, in Prefect 1.0 ECSRun config:
containerDefinitions = [
        dict(
                name = "flow",
                image = "<http://ghcr.io/chicago-joe/intelli-options:latest|ghcr.io/chicago-joe/intelli-options:latest>",
                repositoryCredentials = dict(
                        credentialsParameter = "arn:aws:secretsmanager:us-east-2:xxxxxx:secret:GHCR_PRIVATE_REGISTRY_AUTH-xxxxx")
        )
],
a

Anna Geller

09/27/2022, 12:54 PM
Joe, the issue is resolved now
c

chicago-joe

09/27/2022, 4:32 PM
sweet! I'll give it a try
👍 1
j

Jacqueline Garrahan

10/10/2022, 7:21 PM
Hi- could you point me to docs describing how to configure a docker agent to pull from a private registry with 1.x?
a

Anna Geller

10/11/2022, 10:42 AM
not sure who you ask now but you need:
docker login -u username -p pwd
before starting the agent
c

chicago-joe

10/25/2022, 9:45 PM
@Anna Geller can you provide an example of using repositoryCredentials / credentialsParamater in a prefect 2 ecs-task block? I'm still getting a 401 Unauthorized from the above, it is quite frustrating 😕
a

Anna Geller

10/25/2022, 11:08 PM
ECSTask block uses IAM roles to authenticate with ECR registry
no idea how this works with GH registry, didn't try it since 99% of ECS users use ECR
if this doesn't work for you with your registry though, please open an issue on the prefect-aws repo, we'll figure that out together then