-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for use of variables in devcontainer.json #306
Comments
Variables are supported in @Chuxel I haven't found this documented? |
@egamma You are right, looks like it isn't. I added it as another sample that uses it to bind mount your home directory into the container. Mounting additional volumes is another topic we support but is in tips and tricks, but is more common. Two birds with one stone. I've got it queued up to go with the advanced topics when that goes. |
Thanks for adding docs ! Yes I found that env variables work in the Eg a
Fails like this
I was expecting this to mount the workspace folder from the host into the container at the specified mount point. |
@ahayzen Ah! Got it - yes, that is a feature request, you are right. Removed docs and added the feature-request label given that. |
hi, it would be great to support the variables not only in
and it also did not work. the remote workspace is i want the path of my sources to be equal to the real path. when you're doing go (or other compiler based languages i guess) the path to the sources is part of a stacktrace. i can compile the sources in the container or outside and depending on where i compiled, the source-path's are different. you also cannot debug a binary which was not compiled in the dev-container when the source path's are wrong. everything is easier if the dev-container feels like your local machine. so it would be great to mount and open the same path as it is locally. |
With devcontainer.json {
"workspaceMount": "src=${workspaceFolder}/keymap,dst=/qmk_firmware/keyboards/ergodox_ez/keymaps/ciantic,type=bind,consistency=cached",
"workspaceFolder": "/qmk_firmware",
} |
@Ciantic I had this issue too, maybe you are using Docker Toolbox in a Windows machine, when passing the path to the docker command, is doing something like c:/Users/foo/bar which to Linux is a relative path |
@KevinGuancheDarias @Ciantic @chrmarti Should we consider closing this to avoid future confusion? Even though this mentions other variables, I've never actually seen anyone mention anything other thank workspaceFolder. |
I agree, we support Let's track additional variables in new tasks. Closing this one. |
It would be useful if variables ( https://code.visualstudio.com/docs/editor/variables-reference ) could be used in
devcontainers.json
, at the moment adding variables to, eg,runArgs
fails.A use case for this might be trying to mount data in the project folder to a specific location eg
--volume=${workspaceFolder}/mydb.sqlite:/srv/webapp/mydb.sqlite
.It is possible to workaround this at the moment by using absolute paths but this may allow for more dynamic definitions.
Note environment variable do work.
The text was updated successfully, but these errors were encountered: