When the Docker host used for building images in the build plugins is configured using the DOCKER_HOST environment variable or the docker.host configuration property, this value should be bound to the builder container in order for the CNB lifecycle to access the host. The build plugins currently always bind the default socket /var/run/docker.sock:/var/run/docker.sock instead of effectively binding ${DOCKER_HOST}:/var/run/docker.sock when DOCKER_HOST is set.

Comment From: terminux

Hi, I submitted a PR to fix this issue. #29441

Comment From: scottfrederick

After further research and testing, there are cases where we want the socket to always be bound to /var/run/docker.sock as is currently done and other cases where we want the socket bound to the value of the configured docker host. The /var/run/docker.sock value will always work with Docker Engine and minikube because those daemons make that socket available in the container that uses the binding. Other container engines require a different value like /run/user/1000/podman/podman.sock for podman.

In order to support both cases we will need a build plugin configuration property that the user can enable to select the non-default behavior.