-
Notifications
You must be signed in to change notification settings - Fork 10
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
Dealing with SSH stuff #6
Comments
Sounds useful in case SSH is in use. Do you have a good idea on how to configure that on a project level? Command line arguments are always an option nevertheless, but this should have some comfort. And can you describe (outline) a minimal SSH use-case, this would be helpful for orientation. |
For example one use case could be if you have composer dependencies that must be downloaded from a private GIT repository. In that case you should generate a new key pair inside the container and add the generated public key to the private GIT repo. An idea (I don't know if it's good) could be to have a way (for example with a command line switch) to copy the host SSH keys into the container. Something like:
(but watchout to this issue under Docker for Mac: docker/for-mac#1814) BTW this assume that the current user's keys have the same access of the real pipeline's keys (which is true in most cases in my opinion). |
Composer sounds like a good use-case. Spotted the Private repositories / SSH agent section in the read-me of the composer docker image that has a different approach by making the SSH Agent usable:
This looks interesting to me for two parts:
|
Yes I think is much better than copying ssh keys! |
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. first implementation. Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. first implementation. Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. first implementation. Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. first implementation. Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. first implementation. Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. first implementation. Github-issue: #6
run the step container with docker run otpions: --volume $SSH_AUTH_SOCK:/ssh-auth.sock \ --env SSH_AUTH_SOCK=/ssh-auth.sock volume is only mounted if the SSH_AUTH_SOCK environment variable is accessible. first implementation. Github-issue: #6
run the step container with docker run otpions: --volume $SSH_AUTH_SOCK:/ssh-auth.sock \ --env SSH_AUTH_SOCK=/ssh-auth.sock volume is only mounted if the SSH_AUTH_SOCK environment variable is accessible. first implementation. Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. Github-issue: #6
run the step container with docker run otpions: --volume $SSH_AUTH_SOCK:/ssh-auth.sock \ --env SSH_AUTH_SOCK=/ssh-auth.sock volume is only mounted if the socket from SSH_AUTH_SOCK environment parameter is accessible. Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. Github-issue: #6
run the step container with docker run otpions: --volume $SSH_AUTH_SOCK:/ssh-auth.sock \ --env SSH_AUTH_SOCK=/ssh-auth.sock volume is only mounted if the socket from SSH_AUTH_SOCK environment parameter is accessible. Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. Github-issue: #6
run the step container with docker run otpions: --volume $SSH_AUTH_SOCK:/ssh-auth.sock \ --env SSH_AUTH_SOCK=/ssh-auth.sock volume is only mounted if the socket from SSH_AUTH_SOCK environment parameter is accessible. Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. Github-issue: #6
run the step container with docker run otpions: --volume $SSH_AUTH_SOCK:/ssh-auth.sock \ --env SSH_AUTH_SOCK=/ssh-auth.sock volume is only mounted if the socket from SSH_AUTH_SOCK environment parameter is accessible. example command: <<'PIPELINE' bin/pipelines --file - --verbatim --ssh-auth-sock pipelines: default: - step: image: ktomk/pipelines:ssh script: - mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh -T [email protected] || test $? -eq 1 PIPELINE Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. Github-issue: #6
run the step container with docker run otpions: --volume $SSH_AUTH_SOCK:/run/ssh-auth.sock:ro \ --env SSH_AUTH_SOCK=/run/ssh-auth.sock volume is only mounted if the socket from SSH_AUTH_SOCK environment parameter is accessible. example command: <<'PIPELINE' bin/pipelines --file - --verbatim --ssh pipelines: default: - step: image: ktomk/pipelines:ssh script: - mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh -T [email protected] || test $? -eq 1 PIPELINE Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. Github-issue: #6
run the step container with docker run otpions: --volume $SSH_AUTH_SOCK:/run/ssh-auth.sock:ro \ --env SSH_AUTH_SOCK=/run/ssh-auth.sock volume is only mounted if the socket from SSH_AUTH_SOCK environment parameter is accessible. example command: <<'PIPELINE' bin/pipelines --file - --verbatim --ssh pipelines: default: - step: image: ktomk/pipelines:ssh script: - mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh -T [email protected] || test $? -eq 1 PIPELINE Github-issue: #6
run the step container with docker run options: --user $(id -u):$(id -g) \ --volume /etc/passwd:/etc/passwd:ro \ --volume /etc/group:/etc/group:ro volumes are only mounted if files are locally (read) accessible. Github-issue: #6
run the step container with docker run otpions: --volume $SSH_AUTH_SOCK:/run/ssh-auth.sock:ro \ --env SSH_AUTH_SOCK=/run/ssh-auth.sock volume is only mounted if the socket from SSH_AUTH_SOCK environment parameter is accessible. example command: <<'PIPELINE' bin/pipelines --file - --verbatim --ssh pipelines: default: - step: image: ktomk/pipelines:ssh script: - mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh -T [email protected] || test $? -eq 1 PIPELINE Github-issue: #6
run the step container with docker run otpions: --volume $SSH_AUTH_SOCK:/run/ssh-auth.sock:ro \ --env SSH_AUTH_SOCK=/run/ssh-auth.sock volume is only mounted if the socket from SSH_AUTH_SOCK environment parameter is accessible. example command: <<'PIPELINE' bin/pipelines --file - --verbatim --ssh pipelines: default: - step: image: ktomk/pipelines:ssh script: - mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh -T [email protected] || test $? -eq 1 PIPELINE Github-issue: #6
@mmenozzi Pipelines 0.0.42 is released with a
...
Known hosts is not well integrated and I'm open for suggestions there. |
@mmenozzi not sure if there were open questions left or where you have been heading to since we had this nice conversation, a comment or two how you would like to proceed would be great so that this issue is not hanging so much in the air. but no stress, just asking. I hope you're well. |
Ehi @ktomk I didn’t give any feedback because I wasn’t able to test this feature in my pipelines. I think you can close if it works properly. |
Ah, well, if you could lend me a hand as I don't have mac os at hand and if you have and if you also have some github ssh access to test the "one-liner" example in #6 (comment) ? That would be great @mmenozzi . Just for feedback the |
I tried the one-line command but it hangs with no output. Moreover I can't kill the docker container with |
Thanks a lot. Hmm, I wonder where it hangs. If you could try more verbose:
and paste the output (please redact any personal details). |
The problem was that I was running the command from my home directory so it was trying to copy my whole home directory into the container...
I suppose it's not working... If I run the ssh connection to github outside the container it works of course:
|
My bad, the test suggestion was incomplete. Sorry for the inconvenience. This needs some more thought on resource protection on Thanks for handling this. And yes the result " Docker is started however with the appropriate options (third and second last lines):
So the test failed :). Have to chew a bit on this one and check if and how the ssh sock mounting is actually supported with the macos local docker machine. Thanks for your elaborated testing again! |
From a quick first look it is perhaps that the ssh auth socket is on a different path: It looks possible for another test to make
Maybe if I may ask for another test for this, @mmenozzi ? |
Not working:
Here is my
|
Thanks, that path to the ssh agent socket might have been wrong then. The difference to SSH_AUTH_SOCK was intended though, by default If I may ask another time to try with
And if you could share your macos and docker (for mac) version would be nice. |
Not working:
I have Docker Desktop for Mac Edge 3.0.1 (50773) and macOS BigSur 11.0.1 (20B50). |
It would be great to have a way to copy SSH stuff (public/private keys and host key verification) into the container. This way we could copy the same SSH keys used by the real pipeline.
What do you think?
The text was updated successfully, but these errors were encountered: