Dev Container Env Variables Not Passing on Mac

32 views Asked by At

I have the following devcontainer.json specification:

{
    "build": {
        "dockerfile": "Dockerfile",
        "args": {
            "FOO": "${localEnv:FOO}",
            "BAR": "${localEnv:BAR}"
        }
    },
    "runArgs": [
        "--network=host"
    ],
    "forwardPorts": [ 9000 ],
    "remoteUser": "root",
}

When I start a dev container on my Windows machine, this works fine. The values for $FOO and $BAR are the same as my environment variables. But when my friend starts it on his Mac, the values of $FOO and $BAR are blank.

I verified that he can pop a shell and run echo $FOO with the correct results. It's just not passing in to his devcontainer correctly.

Is this an error on my end? Or is there any known workaround?

0

There are 0 answers