how to use apt-buildpack from cloudfoundry repo

◇◆丶佛笑我妖孽 提交于 2020-01-06 03:56:05

问题


The apt-buildpack is experimental and not yet intended for production use. I guess that's why also no documentation.

Creating container          
Successfully created container                           
Downloading app package...  
Downloaded app package (862.7K)                          
Warning: this buildpack can only be run as a supply buildpack, it can not be run alone                             
Failed to compile droplet: Failed to compile droplet: exit status 1                                                
Destroying container        
Exit status 223             
Stopping instance abdfc8d0-699e-4834-9f2d-2b8aec218423   
Successfully destroyed container  

Can you give me example how to push cf-env sample app and install for example rtorrent and/or openvpn. Is it possible to install gnome for testing purposes?


回答1:


As far as usage goes it's pretty simple, you just need to include an Aptfile in the root directory of your app. That should contain a list of packages to install, one package on each line.

Ex:

$ cat Aptfile
ascii
rtorrent
openvpn

This message:

Warning: this buildpack can only be run as a supply buildpack, it can not be run alone

Is telling you that the Apt buildpack only functions to supply binaries. It doesn't actually know how to run your app or any application. For more on the supply script, check out the docs here.

The trick to making it work is that you need to use multi buildpack support. Instructions for doing that can be found here. This should work with most apps, but there's a simple example here.

Once your app stages & starts, you can confirm that your packages were installed by running cf ssh apt-test -t -c "/tmp/lifecycle/launcher /home/vcap/app bash ''". Anything that was installed should be on the path, but if you want to see where things are installed it'll be under the /home/vcap/deps/<buildpack-number>/.

That should be about it. Hope that helps!



来源:https://stackoverflow.com/questions/46736992/how-to-use-apt-buildpack-from-cloudfoundry-repo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!