0

My docker-compose.yml looks like this

services:
 my-service:
  image: ${PYTHON_IMAGE}:${PY_VERSION}

these ENV variables are declared in WSL, however when I use VS code remote container to launch the development in the container, it will fail, I tried using WSLENV to assign the variables and tested within a session between WSL and Windows, the variables are properly shared but still couldnt get the variables assigned when the container is created/build by VSCode

Appreciate your response Thanks

1 Answers1

0

Right now I get it working using WLSENV

added the following line to .bashrc

export WSLENV=$WSLENV:VAR_NODE_IMAGE_NAME/u:VAR_NODE_VERSION/u
cmd.exe /C  set | grep  '^VAR' | tr '=' ' ' | awk '{printf "SETX %s %s\n", $1, $2}' | cmd.exe >> /dev/null

this will add the env vars to Windows when I launch my terminal