Hi, I'm trying to work through flow registration w...
# prefect-community
Hi, I'm trying to work through flow registration with cloud using Docker storage
I keep getting an exception from docker.py line 544
that says "no basic auth credentials"
So I created some code using the python docker library to log into the registry. That succeeds, and the next thing I do is call
. Same error
So this may be more of a docker question, but any thoughts on how to get past this issue?
Hey @Adam Roderick - I recommend working on this with Docker directly instead of through Prefect’s
call; I suggest starting by trying to pull your
or push to your configured
and seeing if that raises the same error
Thanks, @Chris White. I'll try that
👍 1
Hey @Adam Roderick, I think I had a similar error message at first when trying to register DockerStorage with a private ECR. Double-check the Docker-related configurations that you pass to the Storage object, especially stuff like
-- the defaults may not be optimal. For me in the end, it turned out I had to pass
since the running Docker was configured with that level of security. Otherwise the authentication failed
Thanks @Arsenii. By walking through the steps using the docker CLI, I was able to get past the issue
One thing I have to do is call
to ensure it exists before trying to push to it. That was the only additional thing I ran into
I believe that python docker.login is not saving credentials. If I log in through docker CLI, the creds are saved to ~/.docker/config.json
Not so if I do the login through python
Was an issue in the past; could still be today https://github.com/docker/docker-py/issues/1061
One thing I have to do is call 
Ah, interesting. I'm basically reusing the same repository but assign unique tags to each flow's docker image -- so no need to create new repos all the time
That's a good idea. In our use case, we need many repos
So what is the right way to login via docker before calling
? If I don't login at all, I get the "no basic auth credentials" error.
If I manually log in via the command line, then the creds are saved
But manually logging in doesn't seem like the best way to go
I ended up with this
subprocess.run(['docker', 'login', '-u', username, '-p', password, url])
🧐 1