-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Docker private registry support #562
Comments
thank you for the example - before reading that code, i never understood what this meant - i suppose in ci environments you have to get creative on how to pull your images, so that makes sense. if i understand correctly, this is just passing an auth parameter for pulling an image if it doesnt exist (and workaround is then just to pull the image ahead of time?) |
note the plural
|
Good news. I think I got it working for a single registry:
|
is there a PR to look at or is that just bulit-in functionality from docker-py? |
I have the code (I tried to keep it to something very minimal), not a built in as |
Feel free to assign me :) |
Ref #562 This enhancement adds capability to utilize the env var `DOCKER_AUTH_CONFIG` in-order to login to a private docker registry. --------- Co-authored-by: David Ankin <[email protected]>
Ref testcontainers#562 This enhancement adds capability to utilize the env var `DOCKER_AUTH_CONFIG` in-order to login to a private docker registry. --------- Co-authored-by: David Ankin <[email protected]>
Hello there! I am using amazon-ecr-credential-helper to login to a private AWS ECR registry but the line 103 of core/testcontainers/core/utils.py is raising an
I suppose that this problem could be solve in the line 102 of that file with with a dict as default value of the key
This solution would break in the line 193 of core/testcontainers/core/docker_client.py because it could not get the first element of an empty list. The def login(self, docker_auth_config: str) -> None:
"""
Login to a docker registry using the given auth config.
"""
auth_config = parse_docker_auth_config(docker_auth_config)
if auth_config:
first_auth_config = auth_config[0] # Only using the first auth config
login_info = self.client.login(**first_auth_config._asdict())
LOGGER.debug(f"logged in using {login_info}") Are you agree with this solution? @Tranquility2 @alexanderankin Thank you so much for your contribution to this repository. Have a great day! |
hi @alvaromerinog can you provide a complete code example that can verify that this functionality can work as expected, i can test this and figure out how to add tests for this. absent that, I dont believe that docker-py actually supports this - https://github.com/search?q=repo%3Adocker%2Fdocker-py%20login&type=code - at least from first glance. otherwise, please feel free to use the login helper yourself to get a token, set that as your environment variable, and use the |
Hello @alexanderankin! I may have misunderstood your comment, but my intention is not to implement the ECR login helper using docker-py. In my pipeline I have a preconfigured |
I think we can assume this is a different use case (based on https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#use-credential-helpers)
vs
btw apparently you can also do:
It looks like other mechanisms also use this file to control auth @alvaromerinog are you just trying to get |
Another alternative is to follow
This is not trivial as we will need something like |
@alexanderankin I also have an idea on how we can be more visible regarding this and on the same time avoid the problem @alvaromerinog is facing. |
if testcontainers-java implements invoking |
I need to do some investigation regarding the actual process we will need to invoke. On the bright side, I created #647, I think it will address this issue + adds more clarity on the status + help us prepare for the next steps, please have a look. |
… fields in DOCKER_AUTH_CONFIG) (#647) Continuing #562, got some feedback regarding an issue with unsupported use cases. In this PR we will try to: 1. Map the use cases 2. Raise a warning regarding unsupported uses cases (hopefully they will be added later) 3. Address/Fix the issue where unsupported JSON schema for `DOCKER_AUTH_CONFIG` leads to an error As always any feedback will be much appreciated. _Please note this PR does not implement all use-cases just does a better job at preparing and handling them for now_
Hello everybody. I don't know if this feat request is intended also to add the possibility to have a default prefix for Docker Hub images, in order to use a private Docker Registry configured as proxy cache. In testcontainers-java this default docker hub proxy is configured with an env var: TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX This is super nice for not flooding Docker Hub with pull requests on CI/CD environments, I already use it in Java and I'd like it in python too |
Same issue here. The Because of this we cannot pull from Artifactory and get rate limit from dockerhub
|
What are you trying to do?
I want to use testcontainers with an image store on a private registry. Correct me if I am wrong, It is currently not possible on testcontainers-python but it is possible on testcontainers-java.
Why should it be done this way?
Example on how it is done on testcontainers-java: https://github.com/testcontainers/testcontainers-java/blob/994b385761dde7d832ab7b6c10bc62747fe4b340/core/src/main/java/org/testcontainers/utility/RegistryAuthLocator.java#L37
The text was updated successfully, but these errors were encountered: