sail icon indicating copy to clipboard operation
sail copied to clipboard

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

Open teddy-codes opened this issue 6 years ago • 5 comments

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 avatar May 22 '19 22:05 teddy-codes

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

teddy-codes avatar May 22 '19 22:05 teddy-codes

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 avatar May 23 '19 15:05 nathanpotter

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

nathanpotter avatar May 23 '19 16:05 nathanpotter

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.

teddy-codes avatar May 23 '19 16:05 teddy-codes

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

nathanpotter avatar May 23 '19 19:05 nathanpotter