APT Buildpack

Purpose of This Buildpack

The environment used to build and run applications, based on Ubuntu, is embedding a wide set of libraries and binaries. However, your application might require one or multiple dependencies which are not present by default. The APT buildpack aims at installing additional packages using the apt package manager.

Details about the default environment can be found on the following page: Scalingo Builder - Our base Docker image

Set up this buildpack for your application

This buildpack is designed to be used with one or more additional buildpacks, thanks to the multi buildpack.

When creating a new Scalingo app:

$ scalingo create my-app
$ cat << EOF > .buildpacks
https://github.com/Scalingo/apt-buildpack.git
https://github.com/Scalingo/ruby-buildpack.git
EOF

The above commands configure your application to use the multi buildpack, and define the .buildpacks file. This file configures the different buildpacks to apply. In this example, we configure the APT and the Ruby buildpack.

Configuration

Once the buildpack is configured for your app, the packages to install have to be defined in a file named Aptfile which should be located at the root of the application.

It can contain three types of information:

  • A package name present in the Ubuntu repository
poppler-utils
  • An URL to a .deb package which will be downloaded and installed
http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
  • A :repo:deb instruction to add an APT repository to download packages from
:repo:deb http://cz.archive.ubuntu.com/ubuntu artful main universe

Of course, the three types of value can be combined, for example:

poppler-utils
http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
:repo:deb http://cz.archive.ubuntu.com/ubuntu artful main universe

Fetch packages from signed repositories

To install packages from Personal Package Archive (PPA) or some signed repositories, you can add the trusted option to your Aptfile, for example:

:repo:deb [trusted=yes] http://cz.archive.ubuntu.com/ubuntu artful main universe

You may encounter the warning W: GPG error: http://cz.archive.ubuntu.com/ubuntu: The following signatures couldn't be verified but the repository should still be usable.

Output

At the next deployment, the APT buildpack should be doing its job (example with poppler-utils package):

=====> Downloading Buildpack: https://github.com/Scalingo/apt-buildpack
=====> Detected Framework: Apt
-----> Reusing cache
-----> Updating apt caches
       Ign http://archive.ubuntu.com trusty InRelease
       ...
       Hit http://apt.postgresql.org trusty-pgdg/main amd64 Packages
       Reading package lists...
-----> Fetching .debs for poppler-utils
       Reading package lists...
       Building dependency tree...
       The following extra packages will be installed:
         libpoppler44
       The following NEW packages will be installed:
         libpoppler44 poppler-utils
       0 upgraded, 2 newly installed, 0 to remove and 73 not upgraded.
       Need to get 0 B/824 kB of archives.
       After this operation, 3066 kB of additional disk space will be used.
       Download complete and in download only mode
-----> Installing libpoppler44_0.24.5-2ubuntu4.9_amd64.deb
-----> Installing poppler-utils_0.24.5-2ubuntu4.9_amd64.deb
-----> Writing profile script
-----> Rewrite package-config files

Suggest edits

APT Buildpack

©2024 Scalingo