Inject deb packages into dokku based on files in project.
dokku-apt is a plugin for dokku that installs apt packages in your dokku environment. This is mostly useful for instances where you have an app that depends on packages being here.
dokku 0.32.x+ docker 1.8.x
On your dokku server:
# on dokku 0.18.x+
sudo dokku plugin:install https://github.com/dokku-community/dokku-apt apt
This plugin only applies to buildpack-based applications. Users deploying via Dockerfile or Docker Image should customize those as appropriate.
When you deploy your project, the dokku-apt plugin will install according to your project's apt-repositories
and apt-packages
files. You should store these files in your projects root as the docker container will copy your project to its /app directory. This is where the dokku-apt plugin looks for apt-repositories
and apt-packages
.
The order of operations is:
apt-conf
apt-env
apt-keys
apt-preferences
apt-sources-list
apt-repositories
apt-debconf
apt-packages
dpkg-packages
Utilizing the above files, the base build image will be extended for further use in the build process. If an already extended app image that is compatible with the desired changes is found, then the above will be skipped in favor of using the pre-existing image.
Note that specifying packages within a dpkg-packages
file will always bust the cache, as there is no way for the plugin to know if the files have changed between deploys.
A config file for apt, as documented here. This is moved to the folder /etc/apt/apt.conf.d/99dokku-apt
, and can override any apt.conf
files that come before it in lexicographical order.
Example
Acquire::http::Proxy "http://user:[email protected]:8888/";
A file that can contain environment variables. Note that this is sourced, and should not contain arbitrary code.
Example
export ACCEPT_EULA=y
Usage of apt-keys without verifying the ownership of the key may result in compromising your apt infrastructure.
A file that can contain a list of urls for apt repository keys. Each one is installed via curl "$KEY_URL" | apt-key add -
. Redirects are not followed. The sha256sum
of the key contents will be displayed to allow for key verification.
Requires an empty line at end of file.
Example
https://packages.microsoft.com/keys/microsoft.asc
A file that contains APT Preferences. This file is not validated for correctness, and is installed to /etc/apt/preferences.d/90customizations
.
Example:
APT {
Install-Recommends "false";
}
Overrides the /etc/apt/sources.list
file. An empty file may be provided in order to remove upstream packages.
Example:
deb http://archive.ubuntu.com/ubuntu/ bionic main universe
deb http://archive.ubuntu.com/ubuntu/ bionic-security main universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main universe
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
This file should contain apt packages to install, accepts multiple packages per line, and multiple lines.
If this file is included, an apt-get update
is triggered beforehand.
Example:
nginx
unifont
You can specify a package version with '=1.2.3' after the package name.
Example:
libgd2-dev=2.1.1
Optional file that should contain additional APT repositories to configure to find packages.
If this file is included, an apt-get update
is triggered, and the packages software-properties-common
and apt-transport-https
are installed. Both these actions happen before any repositories are added.
Requires an empty line at end of file.
Example:
ppa:nginx/stable
deb http://archive.ubuntu.com/ubuntu quantal multiverse
Optional file allowing to configure package installation. Use case is mainly for EULA (like ttf-mscorefonts-installer). Requires an empty line at end of file.
Example:
ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true
Optional directory holding .deb
packages to be installed automatically
after apt-packages
, apt-repositories
and apt-debconf
. Allows the
installation of custom packages inside the container.
Packages are installed in lexicographical order. As such, if any packages depend upon one another, that dependency tree should be figured out beforehand.
Example:
$ ls dpkg-packages/
your-package-0_0.0.1.deb