Docker compose failed to pull image behind corporate proxy when buildkit is enabled

Hello,

After updating docker desktop to version 3.2.2, docker-compose up starts failing to pull image from docker io.
I’m using docker behind corporate proxy. Proxy is configured in Recources → proxies and was working fine so far.

After some trubleshooting I know that:

  1. pulling images from other repositories works fine
  2. setting buildkit to false in docker engine configuration solve the issue.
  3. setting https_proxy using SetEnvironmentVariable or configuring it globaly solve the issue

Error message from docker-compose

failed to get console mode for stdout: The handle is invalid.
[+] Building 16.9s (2/3)
=> [internal] load build definition from Dockerfile 0.1s
[+] Building 16.9s (3/3) FINISHED
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.1sailed to authorize: rpc error: code = Unknown desc = failed to fetch anonymous token: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fmaven%3Apull&service=registry.docker.io: di
=> => transferring context: 2B 0.0sarget machine actively refused it.
=> ERROR [internal] load metadata for docker. io/library/maven:3.6.3-ope 16.6s


[internal] load metadata for Docker


ERROR: Service ‘service-mock’ failed to build

Or, as I found elsewhere, to temporarily disable buildkit for one build:
DOCKER_BUILDKIT=0 docker build …

Docker Desktop 3.4.0 throws a similar error for me. I don’t know what buildkit is. Is this workaround safe if you need to share images with your team to have them deployed on Production?

For my part, I have no idea. My only goal at the moment is to get a local development container running. I haven’t tested it outside my local workstation, to see if it builds/runs for someone else or in a different context.