Skip to content
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

[BUG]: Docker@2 overrides DOCKER_CONFIG variable #20188

Open
4 of 7 tasks
horato opened this issue Jul 22, 2024 · 1 comment
Open
4 of 7 tasks

[BUG]: Docker@2 overrides DOCKER_CONFIG variable #20188

horato opened this issue Jul 22, 2024 · 1 comment

Comments

@horato
Copy link

horato commented Jul 22, 2024

New issue checklist

Task name

DockerV2

Task version

2.181.2

Issue Description

In the docker task, when using build command, the cli config is ignored. The task creates its own config.json and overrides the DOCKER_CONFIG variable. This causes the docker CLI to fall back to default settings.
Any settings in %userprofile%\.docker\config.json is then not used (proxy settings, contexts set by the docker context command, etc.).
Using DOCKER_CONTEXT variable then results in an error
Failed to initialize: unable to resolve docker endpoint: context "wsl": context not found: open D:\TFS\BuildAgent-Deploy\_work\_temp\DockerConfig_1721664299281\contexts\meta\42bda76ffe7cdbda57c5a588398717abc50e6da7c8ed430e66fdfb99f4563f65\meta.json: The system cannot find the path specified.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

Azure DevOps Server (Please specify exact version in the textbox below)

Azure DevOps Server Version (if applicable)

Azure DevOps Server 2020 Update 1.2

Operation system

Windows Server 2019

Relevant log output

Starting: d
==============================================================================
Task         : Docker
Description  : Build or push Docker images, login or logout, start or stop containers, or run a Docker command
Version      : 2.181.2
Author       : Microsoft Corporation
Help         : https://aka.ms/azpipes-docker-tsg
==============================================================================
C:\Windows\system32\docker.exe build -f \\build2\Server_Deploy\Dev\Docker\Dockerfile [REDACTED]
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

error during connect: in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.45/build?buildargs=[REDACTED]": open //./pipe/docker_engine: The system cannot find the file specified.
##[error]The process 'C:\Windows\system32\docker.exe' failed with exit code 1
Finishing: d

Full task logs with system.debug enabled

No response

Repro steps

- Install docker on Windows Server 2019
- Disable default daemon
- Setup connection to remote daemon using `docker context create test ...`
- Switch context `docker context use test`
- Run any pipeline with any dockerfile, task DockerV2, command build, with containerRegistry
@nghyjohn
Copy link

I got the same issue, no matter using DOCKER_CONTEXT or DOCKER_CONFIG, also not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants