Using WSL, build_in_docker
with pip requirements.txt fails because docker cannot mount /tmp
#137
Labels
build_in_docker
with pip requirements.txt fails because docker cannot mount /tmp
#137
Description
Using WSL,
build_in_docker
with pip requirements.txt fails because docker cannot mount/tmp
.In
package.py
, thetempdir()
function is usingtempfile.mkdtemp(prefix=prefix)
without specifying thedir
argument. This means the tempdir will default to/tmp
.In WSL,
docker
currently cannot mount paths outside what is made available via the Docker Desktop file sharing settings. Typically, this means only the/c/
or/mnt/c/
paths are available. And only paths accessible from the Windows filesystem can be mounted.This setup causes errors when
package.py
attempts to install the pip requirements.txt packages, because docker cannot find the requirements.txt file when mounting the tempdir at/tmp/...
.Versions
Reproduction
Steps to reproduce the behavior:
Workaround
Thankfully, the default for the
dir
argument oftempfile.mkdtemp
can be influenced by environment variables:Therefore, this works as a workaround, presuming your PWD is available to docker as a shared path from the Windows filesystem:
TMP=$(pwd) terraform apply
The text was updated successfully, but these errors were encountered: