尝试在Docker容器中安装私人PHP存储库

发布于 2025-02-11 09:43:52 字数 1551 浏览 1 评论 0原文

我正在升级需要一个私有软件包的软件包(此软件包的代码托管在Bitbucket上)。 我已经创建了一个带有以下内容的docker-compose.yaml文件:

version: '3'
services:
  composer:
    image: composer:2.3.5
    environment:
      - COMPOSER_CACHE_DIR=/app/.cache/composer
    volumes:
      - .:/app
      - ~/.ssh/id_rsa:/root/.ssh/id_rsa:ro

因此,我只需要运行docker-compose run composer install即可安装所有必需的依赖项,并且可以正常工作完美地使用公共包裹。但是,当它试图安装专用软件包时,我会遇到此错误:

  [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.                                                                                                                                           

我将私钥传递到容器中,甚至在我尝试运行Composer install时,它甚至要求使用密码。继续获得此拒绝错误。

我想念什么吗?

提前致谢!

I'm upgrading a package that requires a private package (the code for this package is hosted on bitbucket).
I've created a docker-compose.yaml file with the following contents:

version: '3'
services:
  composer:
    image: composer:2.3.5
    environment:
      - COMPOSER_CACHE_DIR=/app/.cache/composer
    volumes:
      - .:/app
      - ~/.ssh/id_rsa:/root/.ssh/id_rsa:ro

So I just need to run docker-compose run composer install to install all required dependencies and it works perfectly with public packages. However, when it tries to install the private package I'm getting this error:

  [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.                                                                                                                                           

I'm passing the private key to the container and it even asks for the passphrase when I try to run composer install but I keep getting this Permission denied error.

Am I missing something?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文