From 052ddefcef075838f1aaba4ced821f9d814c7d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastia=CC=81n=20Magri=CC=81?= Date: Wed, 31 Dec 2014 08:03:21 -0430 Subject: [PATCH] Add dpkg-packages directory feature dpkg-packages/ is an optional directory holding .deb packages which will be automatically installed in the final stage of the plugin's pre-build hook. It allows for arbitrary or custom packages to be installed inside the container. --- README.md | 11 +++++++++++ pre-build | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b015656..c0f33ac 100644 --- a/README.md +++ b/README.md @@ -44,5 +44,16 @@ Example: ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true ``` +## dpkg-packages +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. + +Example: + +``` +$ ls dpkg-packages/ +your-package-0_0.0.1.deb +``` [dokku]: https://github.com/progrium/dokku diff --git a/pre-build b/pre-build index bc4feca..a2b2632 100755 --- a/pre-build +++ b/pre-build @@ -24,6 +24,12 @@ if [ -f $DIR/apt-packages ]; then apt-get install -y \$PACKAGES echo "-----> Injected packages: \$PACKAGES" fi +if [ -d $DIR/dpkg-packages ]; then + for pkg in $DIR/dpkg-packages/*.deb; do + dpkg -i \$pkg + echo "-----> Injected package: \$pkg" + done +fi sleep 1 # wait so that docker run has not exited before docker attach EOF ) @@ -31,4 +37,4 @@ id=$(docker run -d $IMAGE /bin/bash -e -c "$COMMAND") #enable logs docker attach $id test $(docker wait $id) -eq 0 -docker commit $id $IMAGE > /dev/null \ No newline at end of file +docker commit $id $IMAGE > /dev/null