Skip to content

Variables such as ${workspaceFolder} not resolved in runArgs #5301

Closed

Description

@aallrd

VSCode Version: 1.57.1
Local OS Version: Fedora 34
Remote OS Version: RHEL 7.6
Remote Extension: Docker (podman 3.1.2)

I am trying use the ${workspaceFolder} variable in the runArgs property of my devcontainer.json file to use the folder opened by VSCode:

"runArgs": [
  "--volume=${workspaceFolder}:/workspaces/${workspaceFolderBasename}:Z",
]

However building the container fails with this error indicating that the variable was not resolved:

[2021-07-06T16:59:09.847Z] Error: error creating named volume "${workspaceFolder}": error running volume create option: names must match [a-zA-Z0-9][a-zA-Z0-9_.-]*: invalid argument

Is it expected?

Could it be the same issue as #5007 ?

Activity

  1. added
    containers
    on Jul 7, 2021
  2. added
    bug
    on Jul 9, 2021
  3. chrmarti commented on Jul 9, 2021

    @chrmarti
    Contributor

    The variable names are slightly different for the devcontainer.json, so we can distinguish between the local names and the names inside the container. --volume=${localWorkspaceFolder}:/workspaces/${localWorkspaceFolderBasename}:Z should work.

  4. added
    *question
    and removed
    bug
    on Jul 9, 2021
  5. locked and limited conversation to collaborators on Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*questioncontainers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions