cloud-foundryaptbuildpack

how to use apt-buildpack from cloudfoundry repo


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?


Solution

  • As far as usage goes it's pretty simple, you just need to include an apt.yml in the root directory of your app. That should contain among other things, the list of packages to install.

    Ex:

    ---
    packages:
    - ascii
    - libxml
    - https://example.com/exciting.deb
    

    The buildpack supports installing package names, deb files, custom APT repositories, and even PPAs.

    Please see the README for further instructions.

    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!