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

How can I map an SSH key into Docker? #31

Closed
kgilpin opened this issue Jun 14, 2016 · 2 comments
Closed

How can I map an SSH key into Docker? #31

kgilpin opened this issue Jun 14, 2016 · 2 comments

Comments

@kgilpin
Copy link
Contributor

kgilpin commented Jun 14, 2016

My SUMMONENVFILE can't be interpreted by Docker.

✗ summon docker run --env-file "@SUMMONENVFILE" myapp
docker: poorly formatted environment: variable '-----END RSA PRIVATE KEY-----' has white spaces.

Here's what it looks like:

✗ summon cat @SUMMONENVFILE                                        
SSH_PRIVATE_KEY_PATH=-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAqLVITDJKy1KHfHG/SKvM07CjP/D7XrAr3Mz2UKzslnxgJKgeA8hENPGuj83Q
...
iY5dzCLuKMiIiPUHfDtrqaNLH+anyJtjmW9Fb1cWFOJLhWVkJAvYeVawwFBooUK1h9cPR728ngsa
5F7/sDUzQZBmRYnpwWFrWrEE1NwvsIWsQ31WIRhs/Xxp9A36ZPnxXWyOtw0XTbd8PmBaYA==
-----END RSA PRIVATE KEY-----
@dustinmm80
Copy link
Contributor

This is a bug in how Docker parses the env file.

moby/moby#12997

Lots of activity on this thread - let's see if they resolve it before implementing a workaround.

@ryanprior
Copy link

As of September 2017 there appears to be no action taken by Docker to remedy this nor any discussion of a workaround. For now the answer to the question is: you can't use @SUMMONENVFILE with Docker if your secrets contain newlines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants