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 ${env:-} in the dockerRun/volumes/localPath #1094

Closed
psaxton opened this issue Jun 25, 2019 · 3 comments
Closed

Support ${env:-} in the dockerRun/volumes/localPath #1094

psaxton opened this issue Jun 25, 2019 · 3 comments

Comments

@psaxton
Copy link

psaxton commented Jun 25, 2019

Issue: Currently, the only variable allowed for substitution in the dockerRun/Volumes/localPath value is ${workspaceFolder}. When trying to use another value such as ${env:HOME}, an error occurs on build:

Command failed: docker run -dt -P --name "MyProject" -v "${env:HOME}/.aws/:/root/.aws:ro"

/bin/sh: 1: Bad substitution

Example:

   "dockerRun": {
      "volumes": [
         {
            "localPath": "${env:HOME}",
            "containerPath": "/root/.aws",
            "permissions": "ro"
         }
      ]
   }

Use case: When developing applications accessing AWS services, configuration and, more importantly authentication credentials, are stored in ~/.aws. Docker requires absolute paths for volume values. The home directory is user dependent.

Plugin version: Problem encountered with version 0.6.4

@psaxton
Copy link
Author

psaxton commented Jun 25, 2019

This issue is related to but not solved by #785.

@philliphoff
Copy link
Member

@psaxton This is a good idea, but likely requires custom logic to parse and resolve environment variables. (I don't believe VS Code provides an API for such resolution, which is why I've only supported such substitutions on an as-needed basis.)

@bwateratmsft
Copy link
Collaborator

Fixed in #1245 since we don't inspect the volumes, just pass along to ShellExecution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants