<#18187 `DOCKER_CONFIG` not respected within `pant...
# github-notifications
c
#18187 `DOCKER_CONFIG` not respected within `pants test` Issue created by torhovland Describe the bug In GitHub Actions, I can successfully log in to Azure Container Registry, then do docker pull. But if
pants test
tries to do the same, it results in:
Copy code
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 am logging in to ACR using this step:
Copy code
- 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 }}
I can see that the ACR login steps yields this: DOCKER_CONFIG=/home/runner/work/_temp/docker_login_1675410905572 This ensures that if I run the following step, that is successful:
Copy code
- name: Test pulling from ACR
  run: docker pull *****<http://registry.azurecr.io/runner/ubuntu20_*****|registry.azurecr.io/runner/ubuntu20_*****>
However,
pants test
is not as successful. The Docker image is configured like this:
Copy code
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>"],
    docker_env_vars=["DOCKER_CONFIG"],
)
I have also tried without
docker_env_vars=["DOCKER_CONFIG"]
, and it doesn't seem to make a difference. Pants version 2.15.0rc2 OS Ubuntu on GitHub Actions Additional info https://pantsbuild.slack.com/archives/C046T6T9U/p1675414472629759 pantsbuild/pants