environments-preview feature not exchanging DOCKER_HOST #18915
Labels
backend: Docker
Docker backend-related issues
backend: Environments
{local,docker,remote}._environment-related issues
bug
Describe the bug
Enabling
environments
breaks the docker build process in CI/CD and complains that theDOCKER_HOST
is in the wrong place.We have a
docker_image
that depends on apex_binary
BUILD
Due to some wheel compatibility issues, we cannot build this
pex_binary
(and subsequentdocker_image
) on our Macs, it only works up in CI/CD (self-hosted GitHub Actions runners) where the machine islinux_x86
.To resolve this issue for ourselves locally, we enabled the
environments
featureBUILD
And we attached the environment to the
pex_binary
BUILD
The idea here is that the
pex_binary
needs to be built on alinux_x86_64
platform and when that platform isn't available locally it should just use thedocker_environment
.This solution is working for us locally, but when we run it up in CI/CD it no longer works. Here is the issue that we're seeing in CI/CD:
Log Output
As far as I can tell, enabling the
environments
feature confusespants
about where theDOCKER_HOST
should be (our GitHub runners haveDOCKER_HOST
set tounix:///run/docker/docker.sock
instead of the defaultunix:///var/run/docker.sock
). We pass this environment variable down in ourpants.toml
file though:pants.toml
For solutions to this we've tried upgrading to
pants==2.15.1rc2
, removing thelocal_environment
completely and just using thedocker_environment
, and also usingpants.ci.toml
to override which environment to use, and even hardcoding theDOCKER_HOST
env var inside ofpants.ci.toml
.All of this worked within CI/CD when we specify no environments at all, but doesn't work locally. However it works locally when we do specify an environment, but doesn't work in CI/CD.
Pants version
2.15.0
/2.15.1rc2
OS
Linux (CI/CD)
Additional info
Add any other information about the problem here, such as attachments or links to gists, if relevant.
The text was updated successfully, but these errors were encountered: