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

Using ENV var instructions in Readme Leads to invalid key #10

Open
byoung opened this issue Oct 22, 2020 · 1 comment
Open

Using ENV var instructions in Readme Leads to invalid key #10

byoung opened this issue Oct 22, 2020 · 1 comment

Comments

@byoung
Copy link

byoung commented Oct 22, 2020

Spinning up a key server while following the ENV var setup instructions will lead to an invalid key.

Running this to startup the key server

docker run -e DOCKER-SSH-KEY="$(cat ~/.ssh/id_rsa)" --name=keyserver -d mdsol/docker-ssh-exec -server

Then running any build command with a Dockerfile that contains a git clone of a private repo:

RUN docker-ssh-exec git clone -q 'ssh://[email protected]/mdsol/belker-python.git'

Will lead to this error

Step 9/21 : RUN docker-ssh-exec git clone -q 'ssh://[email protected]/mdsol/belker-python.git'
 ---> Running in d35e5372139e
Broadcasting UDP key request...
Got key from server.
Broadcasting UDP env request...
Recieved env from server
Setting 0 ENV vars from server: 
Writing key to /root/.ssh/id_rsa
Running command: git clone -q ssh://[email protected]/mdsol/belker-python.git
Warning: Permanently added the RSA host key for IP address '140.82.114.4' to the list of known hosts.
Load key "/root/.ssh/id_rsa": invalid format
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Using the first (non ENV var) method to spin up the container does work.

@byoung
Copy link
Author

byoung commented Oct 22, 2020

Only difference in the key between the two methods was that the env var approach stripped the trailing newline.

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

No branches or pull requests

1 participant