coder / sail

Deprecated: Instant, pre-configured VS Code development environments.
https://sail.dev
MIT License
627 stars 36 forks source link

How do you access the host environment variables within the sail file? #175

Open teddy-codes opened 5 years ago

teddy-codes commented 5 years ago

I am looking to add a share to my project.

How would I go about evaluating dirname $SSH_AUTH_SOCK before adding it to the share?

teddy-codes commented 5 years ago

Possibly support a --docker-flag array of arguments that are directly passed to the docker command? Not sure if that would be the best solution though

nathanpotter commented 5 years ago

This is definitely a limitation currently with share labels. We've discussed evaluating environment variables in share paths, but thought it may get pretty messy.

The --docker-flag option could work, but on the other hand it may be overly generic. @ammario what are your thoughts?

nathanpotter commented 5 years ago

Also, by default your $SSH_AUTH_SOCK should be mounted in if it exists, and the ENV should be set correctly inside the container

teddy-codes commented 5 years ago

Maybe, the reason why I thought not is because of .gitconfig re: #171. I still think that mounting envs would be useful (for example, NPM_TOKEN) which cannot be present in the .sal/Dockerfile since it is under source control.

nathanpotter commented 5 years ago

Yeah I agree, I'll add a card to the board for passing ENVs and ENV mounts