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

Volume mounting SSH keys not working #68

Closed
HeathNaylor opened this issue Dec 7, 2018 · 3 comments
Closed

Volume mounting SSH keys not working #68

HeathNaylor opened this issue Dec 7, 2018 · 3 comments

Comments

@HeathNaylor
Copy link

I am attempting to pass in my local SSH private key. To do so I am volume mounting ~/.ssh/id_rsa into /root/.ssh/id_rsa. This is the command I am using:

docker run -v `pwd`:/app -v ~/.ssh:/root/.ssh composer install

When it gets down to my private repository as described by the composer.lock file, I get the following error (private information substituted with filler text):

Installing myorg/mypackage (1.0.0): Downloading (failed)    Failed to download myorg/mypackage from dist: The "https://api.gi
thub.com/repos/myorg/mypackage/zipball/<random_hash>" file could not be downloaded (HTTP/1.1 404 Not Found)

Now trying to download from source
  - Installing myorg/mypackage (1.0.0): Cloning <random_hash>

  [RuntimeException]

  Failed to execute git clone --no-checkout 'git@github.com:myorg/mypackage.git' '/app/vendor/myorg/mypackage' && cd '/app/vendor/
myorg/mypackage' && git remote add composer 'git@github.com:myorg/mypackage.git' && git fetch composer
@alcohol
Copy link
Member

alcohol commented Dec 9, 2018

did you try running that command manually inside the container by launching a shell instead of composer to see what error git returns?

@alcohol
Copy link
Member

alcohol commented Dec 9, 2018

one of the frequent causes for this kind of error is when the ssh key is owned by a user that the git process cannot recognize (you need to mount /etc/passwd and /etc/group into the container as well - read-only recommended).

@HeathNaylor
Copy link
Author

I will work on getting directly into the container and seeing permissions today.

@alcohol alcohol closed this as completed Jan 30, 2019
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

2 participants