简体   繁体   English

CloudControl:如何在映像构建过程中使用Composer安装私有存储库?

[英]Cloudcontrol: how to install private repositories with composer during image build process?

I am using cloudcontrols standard buildback-php. 我正在使用cloudcontrols标准buildback-php。 I am using composer to install third party libs. 我正在使用composer安装第三方库。 These also includes private git repositories typically accessible via ssh deployment keys. 这些还包括通常可以通过ssh部署密钥访问的私有git存储库。

Problem: accessing private repositories during the cloudcontrol image build process does not work due to missing ssh private keys. 问题:由于缺少ssh私钥,因此在cloudcontrol映像构建过程中访问私有存储库不起作用。

I found a workaround solution that seems to work with heroku (private key is downloaded, decrypted and installed during build process): 我找到了一种似乎可与heroku配合使用的解决方法 (在构建过程中已下载,解密和安装了私钥):

https://github.com/taniele/heroku-buildpack-php-mongo#composer-private-repository-support https://github.com/taniele/heroku-buildpack-php-mongo#composer-private-repository-support

Another solution is provided by fortrabbit (one time server side ssh key generation): fortrabbit(一次服务器端ssh密钥生成)提供了另一种解决方案:

http://fortrabbit.com/docs/in-depth/git-hooks/sshkeygen http://fortrabbit.com/docs/in-depth/git-hooks/sshkeygen

Questions : 问题

Is there any known secure solution for cloudcontrol? 是否有任何已知的云控制安全解决方案?

How can I access CONFIG_VARS added via the config addon or the related creds.json file during the image build process before composer is executed? 在执行作曲家之前,如何在映像构建过程中访问通过config插件或相关creds.json文件添加的CONFIG_VARS?

cloudControl provides a key pair per application. cloudControl为每个应用程序提供一个密钥对。 The public key is provided via the command line client and can be used to access private repositories. 公用密钥是通过命令行客户端提供的,可用于访问私有存储库。 When pulling in dependencies from Git repositories via SSH this key pair is automatically used. 通过SSH从Git存储库获取依赖项时,将自动使用此密钥对。 Simply allow access to the respective repository using this public key. 只需使用此公钥允许访问相应的存储库即可。

You can get the key with this command: 您可以使用以下命令获取密钥:

$ cctrlapp APP_NAME details
[..]
Public Key: ssh-rsa AAAAB3NzaC...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM