gifted-refrigerator-82216
10/24/2023, 7:43 AMdocker_environment()
to run a test in a container and pants fails to pull the image from a private registry.
The image is available in a private JFrog Artifactory, with credentials set up in my ~/.docker/config.json
so that docker pull
works.
I don't have the pants docker backend enabled (since I don't intend to build an image via pants). pants.toml
only contains one entry under environments-preview.names
for connecting the test to the docker_environment()
, which looks like this:
docker_environment(
name="image_test_video_utils",
image="<http://artifactory.mycorp.com/test_video_utils:0.1|artifactory.mycorp.com/test_video_utils:0.1>",
)
When the image is not yet available on the host (i.e. not listed by docker image ls
) and I run pants test ..
, pants fails to pull the image:
[INFO] Starting: Pulling Docker image `<http://artifactory.mycorp.com/test_video_utils:0.1|artifactory.mycorp.com/test_video_utils:0.1>` because the image is missing locally.
[INFO] Completed: Pulling Docker image `<http://artifactory.mycorp.com/test_video_utils:0.1|artifactory.mycorp.com/test_video_utils:0.1>` because the image is missing locally.
[ERROR] 1 Exception encountered:
Engine traceback:
in `test` goal
IntrinsicError: Failed to pull image `<http://artifactory.mycorp.com/test_video_utils:0.1|artifactory.mycorp.com/test_video_utils:0.1>`: Failed to pull Docker image `<http://artifactory.mycorp.com/test_video_utils:0.1|artifactory.mycorp.com/test_video_utils:0.1>`: DockerResponseServerError { status_code: 500, message: "Head \"<https://artifactory.mycorp.com/v2/docker-local/test_video_utils/manifests/0.1>\": unknown: Authentication is required" }
However, when I pull the image manually via docker pull
, there's no such error and it works as expected. Any idea how to fix that?
Thank you!gifted-refrigerator-82216
10/25/2023, 7:22 AM