Open cmoulliard opened 4 days ago
I think that we should find a way to mount a volume containing the docker config.json or podman auth.json to the lifecycle container we are creating
This old hack is still working - https://github.com/buildpacks/spec/issues/277#issuecomment-992900561
export CNB_REGISTRY_AUTH='{"index.docker.io":"Basic Y2g....3"}'
// Within the code, add the following env var
envMap.put("CNB_REGISTRY_AUTH",System.getenv("CNB_REGISTRY_AUTH"));
I think handling authentication in general is something the library could do better in a future revision.
Glad to see that the env var worked.. feels like we should add a section on auth to the docs to cover creation of dockerclient & setting env var appropriately, covering the scenarios where various registries need auth from different places.
For as a future feature, we could look at adding json to the ephemeral build container, that would likely be the cleanest way to provide creds to the lifecycle.
Also, to avoid misunderstanding here..
If we execute the code of the Build me sample on a fedora VM running podman 5.2.3 with the sock file, then we got the docker limit error
You received the docker limit error because you have exceeded dockerhub's limits for unauthenticated usage.. the same will not hold true for every user.
Executing the code of the build me sample does indeed use dockerhub, but the limits are generous enough that using the samples alone is not enough to trigger that limit.
The github action running the tests for this project also runs authenticated and has no issue.
I have altered the title of this issue to be clearer.
For as a future feature, we could look at adding json to the ephemeral build container, that would likely be the cleanest way to provide creds to the lifecycle.
This is a better option and also what we do using the Buildpack Tekton's task where we mount such recredentials (= docker.json, etc) from a volume
Issue
If we execute the code of the Build me sample on a fedora VM running podman 5.2.3 with the sock file, then we got the docker limit error even if we set the username, password of the dockerclient
Error