Skip to content

Support for ${env:HOME} not working #1961

@bryceschober

Description

@bryceschober

I feel like I have the same issue as #1094, on version 1.1.0. My docker run task looks like:

        {
            "label": "Run JupyterLab",
            "type": "docker-run",
            "dockerRun": {
                "image": "jupyter/datascience-notebook:latest",
                "command": "start-notebook.sh'",
                "env": {
                    "RESTARTABLE": "yes",
                    "JUPYTER_ENABLE_LAB": "yes"
                },
                "ports": [{
                    "hostPort": 8888, 
                    "containerPort": 8888
                }],
                "volumes": [{
                    "localPath": "${env:HOME}",
                    "containerPath": "/home/jovyan/work",
                    "permissions": "rw"
                }]
            }
        }

I get the same terminal error:

/bin/sh: 1: Bad substitution

The resulting command generated by VS Code is (obviously without the line-wrapping for convenience):

docker run -dt -e "RESTARTABLE=yes" -e "JUPYTER_ENABLE_LAB=yes" \
  --label "com.microsoft.created-by=visual-studio-code" \
  -v "${env:HOME}:/home/jovyan/work:rw" \
  -p "8888:8888" "jupyter/datascience-notebook:latest" start-notebook.sh

Note the unexpanded ${env:HOME}. If I fix that by replacing it with $HOME on a VS Code terminal and run it manually, it launches the docker container as expected.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions