Use environment variable to mount in Visual Studio code devcontainer.json

Viewed 324

When using visual studio code with docker container, I want to mount a directory. It works of course as below.

In devcontainer.json

"mounts": ["source=${localEnv:HOME}/dataset,target=/corpus,type=bind,consistency=cached"]

But I am hesitant to include this configuration to source control such as Git. Because the source path can be different upon each instantiation of the container. I think mounts in devcontainer.json file reference host environment variable upon starting the container would be more preferred. So I am asking.

0 Answers
Related