Skip to content

Commit

Permalink
Add dpkg-packages directory feature
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sebasmagri committed Feb 24, 2015
1 parent 094f2cb commit 052ddef
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 7 additions & 1 deletion pre-build
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ 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
)
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
docker commit $id $IMAGE > /dev/null

0 comments on commit 052ddef

Please sign in to comment.