diff --git a/README.md b/README.md index b28f028..fa1b94f 100644 --- a/README.md +++ b/README.md @@ -28,19 +28,30 @@ When you deploy your project, the dokku-apt plugin will install according to you The order of operations is: -1. `apt-env` -2. `apt-keys` -3. `apt-preferences` -4. `apt-sources-list` -5. `apt-repositories` -6. `apt-debconf` -7. `apt-packages` -8. `dpkg-packages` +1. `apt-conf` +2. `apt-env` +3. `apt-keys` +4. `apt-preferences` +5. `apt-sources-list` +6. `apt-repositories` +7. `apt-debconf` +8. `apt-packages` +9. `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. +### `apt-conf` + +A config file for apt, as documented [here](https://linux.die.net/man/5/apt.conf). 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:password@proxy.example.com:8888/"; +``` + ### `apt-env` A file that can contain environment variables. Note that this is sourced, and should not contain arbitrary code. diff --git a/internal-functions b/internal-functions index 9e24fd5..7960cb7 100755 --- a/internal-functions +++ b/internal-functions @@ -27,7 +27,7 @@ fn-apt-fetch-sha() { return fi - APT_FILES=('apt-env' 'apt-keys' 'apt-preferences' 'apt-sources-list' 'apt-repositories' 'apt-debconf' 'apt-packages') + APT_FILES=('apt-conf' 'apt-env' 'apt-keys' 'apt-preferences' 'apt-sources-list' 'apt-repositories' 'apt-debconf' 'apt-packages') for file in "${APT_FILES[@]}"; do if [[ -f "$SOURCECODE_WORK_DIR/$file" ]]; then INJECT_PACKAGES=true @@ -47,7 +47,7 @@ fn-apt-populate-work-dir() { declare SOURCECODE_WORK_DIR="$1" TMP_WORK_DIR="$2" local APT_FILES file - APT_FILES=('apt-env' 'apt-keys' 'apt-preferences' 'apt-sources-list' 'apt-repositories' 'apt-debconf' 'apt-packages') + APT_FILES=('apt-conf' 'apt-env' 'apt-keys' 'apt-preferences' 'apt-sources-list' 'apt-repositories' 'apt-debconf' 'apt-packages') for file in "${APT_FILES[@]}"; do if [[ -f "$SOURCECODE_WORK_DIR/$file" ]]; then cp "$SOURCECODE_WORK_DIR/$file" "$TMP_WORK_DIR/$file" @@ -61,6 +61,11 @@ fn-apt-command() { # $APP $DOKKU_IMAGE sleep 2 export DEBIAN_FRONTEND=noninteractive +if [ -f $DIR/apt-conf ]; then + echo "-----> Copying apt-conf file into place" + mv -v $DIR/apt-conf /etc/apt/apt.conf.d/99dokku-apt +fi + if [ -f $DIR/apt-env ]; then echo "-----> Sourcing apt env" source $DIR/apt-env