flat-baker-18525
02/03/2023, 8:54 AMdocker pull
. But if pants test
(version 2.15.0rc2) tries to do the same, it results in:
Exception: Failed to pull image `***<http://registry.azurecr.io/runner/ubuntu20_***|registry.azurecr.io/runner/ubuntu20_***>`: Failed to pull Docker image `***<http://registry.azurecr.io/runner/ubuntu20_***|registry.azurecr.io/runner/ubuntu20_***>`: DockerResponseServerError { status_code: 500, message: "Get \"[https://***<http://registry.azurecr.io/v2/runner/ubuntu20_***/tags/list\|registry.azurecr.io/v2/runner/ubuntu20_***/tags/list\>](https://***<http://registry.azurecr.io/v2/runner/ubuntu20_***/tags/list/|registry.azurecr.io/v2/runner/ubuntu20_***/tags/list/>)": unauthorized: authentication required, visit <https://aka.ms/acr/authorization> for more information." }
I can see that the ACR login steps yields this:
DOCKER_CONFIG=/home/runner/work/_temp/docker_login_1675410905572
I have tried with:
[docker]
build_args = ["GIT_SHA"]
env_vars = ["DOCKER_CONFIG"]
[test]
extra_env_vars = ["DOCKER_CONFIG"]
as well as without the env_vars
and extra_env_vars
above, but it fails either way.curved-television-6568
02/06/2023, 1:44 PMflat-baker-18525
02/06/2023, 1:50 PM- name: Login to ACR
uses: azure/docker-login@v1
with:
login-server: *****<http://registry.azurecr.io|registry.azurecr.io>
username: ${{ secrets.SP_ACR_PULL_ID }}
password: ${{ secrets.SP_ACR_PULL_PASSWORD }}
This yields a DOCKER_CONFIG
, which makes sure that a step like this is successful:
- name: Test pulling from ACR
run: docker pull *****<http://registry.azurecr.io/runner/ubuntu20_*****|registry.azurecr.io/runner/ubuntu20_*****>
curved-television-6568
02/06/2023, 1:55 PMDOCKER_CONFIG
env var in that case, fwict from the action. 🤔curved-television-6568
02/06/2023, 1:56 PMdocker_image
target that it is failing for, or a docker_environment
?curved-television-6568
02/06/2023, 1:58 PMDockerResponseServerError …it doesn’t look like a
docker_image
in which case I guess it is for a docker_environment
in which case we need to rope in @witty-crayon-22786 or @fast-nail-55400 as I’m not familiar with the Docker support in the engine itself.flat-baker-18525
02/06/2023, 2:00 PMpants test
asking for an image that is defined like this:
docker_environment(
name="docker-env-ubuntu20-*****",
platform="linux_x86_64",
image="*****<http://registry.azurecr.io/runner/ubuntu20_*****|registry.azurecr.io/runner/ubuntu20_*****>",
python_bootstrap_search_path=["<PATH>"],
)
curved-television-6568
02/06/2023, 2:01 PM[docker]
config section doesn’t apply, I think.. sorry for the confusion.curved-television-6568
02/06/2023, 2:04 PMcurved-television-6568
02/06/2023, 2:05 PMdocker_environment
target..flat-baker-18525
02/06/2023, 2:21 PMdocker_environment(
name="docker-env-ubuntu20-*****",
platform="linux_x86_64",
image="*****<http://registry.azurecr.io/runner/ubuntu20_*****|registry.azurecr.io/runner/ubuntu20_*****>",
python_bootstrap_search_path=["<PATH>"],
docker_env_vars=["DOCKER_CONFIG"],
)
Unfortunately, it didn’t help.flat-baker-18525
02/06/2023, 2:25 PMdocker.env_vars
and test.extra_env_vars
. Not sure if they should be there or not. The thread I linked at the top seemed to indicate they shouldn’t:
removing DOCKER_CONFIG from env_vars fixed it /shrug
curved-television-6568
02/06/2023, 2:40 PMdocker_image
target.. so it’s completely different implementations between these two targets, as docker_environment
is implemented in the Pants’s rust engine talking directly with the Docker daemon API (using some rust crate for it), where as docker_image
is a backend plugin written in Python shell-ing out to the docker
CLI client.flat-baker-18525
02/06/2023, 2:42 PMdocker_environment
as well, but took it out when testing taking it out from those two others.witty-crayon-22786
02/06/2023, 5:37 PMflat-baker-18525
02/07/2023, 8:17 AMwitty-crayon-22786
02/07/2023, 5:53 PMcurved-television-6568
02/07/2023, 5:57 PMwitty-crayon-22786
02/07/2023, 6:22 PMfast-refrigerator-12613
10/21/2024, 3:23 PMDOCKER_HOST
and DOCKER_CONFIG
through without stating them explicitly in the docker_environment
. So, I must be confused on the workaround here. Any pointers?