[docker_environment :whale:*]* Hey, y’all! I’m te...
# general
b
[docker_environment 🐳*]* Hey, y’all! I’m testing out the environments feature to enable building Docker images for x86_64 on a arm64 computer (Mac M1) and am currently running into an issue. This is happening while trying to build a
pex_binary
which uses a
docker_environment
(python:3.8-slim image) 👇
Copy code
Engine traceback:
  in `package` goal

ProcessExecutionFailure: Process 'Extract environment variables from the Docker image python:3.8-slim' failed with exit code 126.
stdout:
OCI runtime exec failed: exec failed: unable to start container process: chdir to cwd ("/pants-sandbox/pants-sandbox-L2koQA") set in config.json failed: no such file or directory: unknown

stderr:
I *exec*ed into the container that was created and confirmed that indeed the referred folder
/pants-sandbox/pants-sandbox-L2koQA
did not exist. The image attached shows the folders within the container that were mounted by pants during creation. Have any of you experienced something similar? I’m accepting suggestions on how to debug it further 🙏
I confirmed that the container is being created with three bind mounts, one for each of the top-level folders listed above, but somehow the
pants-sandbox/pants-sandbox-{suffix}
folder is not there, which is probably causing the issue
Copy code
"Mounts": [
            {
                "Type": "bind",
                "Source": "/private/var/folders/vj/chbx1tms2c93nmnnp2gw4wh80000gq/T",
                "Destination": "/pants-sandbox",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "volume",
                "Name": "pants-named-caches-cc370ef311d3",
                "Source": "/var/lib/docker/volumes/pants-named-caches-cc370ef311d3/_data",
                "Destination": "/pants-named-caches",
                "Driver": "local",
                "Mode": "z",
                "RW": true,
                "Propagation": ""
            },
            {
                "Type": "bind",
                "Source": "/private/var/folders/vj/chbx1tms2c93nmnnp2gw4wh80000gq/T/immutable_inputsxFxvB8",
                "Destination": "/pants-immutable-inputs",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ]
v
hey @billowy-tiger-59247 , ran into a similar looking error (https://pantsbuild.slack.com/archives/C046T6T9U/p1696446362309689). curious if you found a resolution here?
b
hey @victorious-zebra-49010! Sadly I had to deprioritize this investigation and couldn’t find a fix (which is sad because this feature would solve so many issues for me hahah). I’ll follow along with the discussion on your thread to see if I can add (or take) anything to/from it 😃
❤️ 1
Just getting back here after finally figuring out what the issue was! I’m using colima as container runtime for the M1 and, by default, it only mounts the
~
and
/tmp/colima
inside the VM where the container runtime is executed. Since pants’ temporary working directory that is shared with the container lives on
/private/var/folders
, I had to set that additional mount on colima’s config explicitly. After that, things started working as expected. 😃
v
thanks for the followup!