Skip to content
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

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

Closed
bryceschober opened this issue May 9, 2020 · 2 comments · Fixed by #2250
Closed

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

bryceschober opened this issue May 9, 2020 · 2 comments · Fixed by #2250

Comments

@bryceschober
Copy link

bryceschober commented May 9, 2020

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.

@bwateratmsft
Copy link
Contributor

This is primarily due to #1413 which is blocked by microsoft/vscode#81007. We had to implement a custom variable resolver because CustomExecution offered no way to resolve using the built-in resolver, and our implementation didn't include support for ${env:...}. @bryceschober can you chime in on the VSCode issue to voice support? 😄

@bwateratmsft
Copy link
Contributor

This is now fixed in Docker extension version 1.7.0.

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants