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

SSH persmission denied issue #364

Closed
webphpprojects opened this issue Dec 29, 2020 · 2 comments
Closed

SSH persmission denied issue #364

webphpprojects opened this issue Dec 29, 2020 · 2 comments

Comments

@webphpprojects
Copy link

Hello,
Description

[RuntimeException]                                                                                                                                                                                      
  Failed to execute git clone --no-checkout 'ssh://my repo'
  '/var/www/html/vendor/package' && cd '/var/www/html/vendor/package' && git remote add composer 'ssh://my repo' && git fetch composer && git remote set-url origin 'ssh://my repo' && git remote set-url composer 'ssh://my repo'                                                                                                                    
                                                                                                                                                                                                          
  Cloning into '/var/www/html/vendor/package'...                                                                                                                                                         
  git@my repo: Permission denied (publickey).                                                                                                                                                  
  fatal: Could not read from remote repository.                                                                                                                                                           
                                                                                                                                                                                                          
  Please make sure you have the correct access rights                                                                                                                                                     
  and the repository exists. 

Steps To Reproduce

  1. curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash
  2. git clone [email protected]:myrepo.git src
  3. echo "127.0.0.1 ::1 yoursite.test" | sudo tee -a /etc/hosts
  4. docker-compose up -d
  5. rm -rf src/vendor
  6. bin/copytocontainer --all
  7. bin/composer install

Expected Result
All vendor packages are downloaded
Actual Result
One of the package cannot be downloaded

One more information. If I try to get this repo without docker (this project) - so not using composer - I can clone it - so ssh permission issue is related to docker container and looks that my ssh key was not copied to that container. But I don't know how to fix it. Could you help?

@rangerz
Copy link
Contributor

rangerz commented Dec 29, 2020

Uncomment this line
#- ~/.ssh/id_rsa:/var/www/.ssh/id_rsa:cached in docker-compose.dev.yml
and try to restart docker bin/restart
(as same as docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d --remove-orphans)

@webphpprojects
Copy link
Author

Yes, it's a solution, thank you! :)

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