diff options
author | Carlo Landmeter <clandmeter@alpinelinux.org> | 2020-01-10 09:16:18 +0100 |
---|---|---|
committer | Carlo Landmeter <clandmeter@alpinelinux.org> | 2020-01-11 17:39:10 +0100 |
commit | 92e1d5f5fb737da2bafd6e114c2c53cbb8e2280d (patch) | |
tree | bbbb327f9e92e1742b53aaa116d6aa1e6fc7860b /entrypoint.sh | |
parent | f0862dd4808dd4594250cd1d34ae09acdedff919 (diff) | |
download | docker-abuild-92e1d5f5fb737da2bafd6e114c2c53cbb8e2280d.tar.bz2 docker-abuild-92e1d5f5fb737da2bafd6e114c2c53cbb8e2280d.tar.xz |
add apk cache and simplify named volumes
- apk supports caching of packages for reuse on next run. This is the
prefered way and should be relativly fast compared to other package
magenagers. This also removed the need for other named volumes which
need to be setup and maintained on each run.
- correcly set perm of volume mount points
Diffstat (limited to 'entrypoint.sh')
-rwxr-xr-x | entrypoint.sh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/entrypoint.sh b/entrypoint.sh index c9dfc55..a76a84d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,10 +13,8 @@ if [ "$DABUILD_DEBUG" = "true" ]; then PS4='$LINENO: ' fi -## check can write to ~/.abuild -if [ ! -w "$HOME/.abuild/" ]; then - die "Error: unwritable ~/.abuild [$(ls -lad ~/.abuild | cut -d " " -f 1)]" -fi +# enable ccache if requested +[ "$DABUILD_CCACHE" = "true" ] && export USE_CCACHE=1 ## generate signing keys on first run if [ ! -r "$HOME/.abuild/abuild.conf" ]; then @@ -30,6 +28,16 @@ fi fi ) +# make sure distfiles has correct permissions +sudo install -d -m 775 -g abuild /var/cache/distfiles + +# correct permissions of user volumes +for vpath in /home/builder/.ccache /home/builder/.abuild \ + /home/builder/packages +do + [ -d "$vpath" ] && sudo chown builder:builder "$vpath" +done + sudo cp -v "$HOME"/.abuild/*.rsa.pub /etc/apk/keys/ sudo apk -U upgrade -a |