Skip to content

Commit 2a6bd39

Browse files
committed
Merge pull request #7 from sebasmagri/dpkg-packages
Add dpkg-packages directory feature
2 parents 094f2cb + 052ddef commit 2a6bd39

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,16 @@ Example:
4444
ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true
4545
```
4646

47+
## dpkg-packages
48+
Optional directory holding `.deb` packages to be installed automatically
49+
after `apt-packages`, `apt-repositories` and `apt-debconf`. Allows the
50+
installation of custom packages inside the container.
51+
52+
Example:
53+
54+
```
55+
$ ls dpkg-packages/
56+
your-package-0_0.0.1.deb
57+
```
4758

4859
[dokku]: https://github.com/progrium/dokku

pre-build

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,17 @@ if [ -f $DIR/apt-packages ]; then
2424
apt-get install -y \$PACKAGES
2525
echo "-----> Injected packages: \$PACKAGES"
2626
fi
27+
if [ -d $DIR/dpkg-packages ]; then
28+
for pkg in $DIR/dpkg-packages/*.deb; do
29+
dpkg -i \$pkg
30+
echo "-----> Injected package: \$pkg"
31+
done
32+
fi
2733
sleep 1 # wait so that docker run has not exited before docker attach
2834
EOF
2935
)
3036
id=$(docker run -d $IMAGE /bin/bash -e -c "$COMMAND")
3137
#enable logs
3238
docker attach $id
3339
test $(docker wait $id) -eq 0
34-
docker commit $id $IMAGE > /dev/null
40+
docker commit $id $IMAGE > /dev/null

0 commit comments

Comments
 (0)