For a new docker-container builder, put the variables on the BuildKit service:

docker buildx create --name proxy-builder --driver docker-container --driver-opt env.HTTP_PROXY=http://proxy.example:8080 --driver-opt env.HTTPS_PROXY=http://proxy.example:8080
docker buildx build --builder proxy-builder .

env.<key> driver options place values inside that builder container. Use an endpoint it can reach; its loopback is not the host terminal. For permitted public registry requests, the HTTP proxy list supplies candidates for the driver’s HTTP proxy URLs.

DownloadConsumer/input
Obtain BuildKit imageDocker daemon route
Build orchestration/base resolutionBuildKit service driver environment
Downloader inside RUNStep's build environment, including supported proxy arguments

A build argument cannot reconfigure a running BuildKit process, and its driver environment does not establish the RUN package manager's inputs. Match this pattern to the actual driver/network; remote or integrated builders can use another service configuration.

Erthyglow kevrennek