Hi there, did anyone get a Docker infrastructure ...
# ask-community
t
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.
Copy code
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
Are you asking for a private DockerHub registry?
t
No, selfhosted registry within our network. But this shouldn't make any difference because we can specify the url , right?
a
for public images, you could set it on the infra block without using
DockerRegistry
block:
Copy code
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
Ok. I will open a issue with MRE
thanks
a
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
No, I didn't opened one. Waited for your feedback
a
ok, let me create it then and I will link here and you can add more info
t
Great, thanks
a
c
@Anna Geller what about doing this with an ECSTask? For example, in Prefect 1.0 ECSRun config:
Copy code
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
Joe, the issue is resolved now
c
sweet! I'll give it a try
👍 1
j
Hi- could you point me to docs describing how to configure a docker agent to pull from a private registry with 1.x?
a
not sure who you ask now but you need:
docker login -u username -p pwd
before starting the agent
c
@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
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