This commit is contained in:
jpic 2020-01-26 12:44:34 +01:00
parent d43affe9bc
commit bb5510a934
5 changed files with 11 additions and 25 deletions

View File

@ -24,7 +24,7 @@ class Packages:
self.packages = list(packages)
self.mgr = None
def init_build(self, script):
def pre_build(self, script):
base = script.container.variable('base')
for mgr, cmds in self.mgrs.items():
cmd = ['podman', 'run', base, 'sh', '-c', f'type {mgr}']

View File

@ -1,18 +1,15 @@
#/usr/bin/env bash
base="alpine"
repo="None"
tag="None"
image="None"
mounts=()
umounts() {
for i in "${mounts[@]}"; do
umount $i
echo $mounts
mounts=("${mounts[@]/$i}")
echo $mounts
done
buildah unmount $ctr
trap - 0
}
trap umounts 0
ctr=$(buildah from $base)
mnt=$(buildah mount $ctr)
mounts=("$mnt" "${mounts[@]}")

View File

@ -1,18 +1,15 @@
#/usr/bin/env bash
base="alpine"
repo="None"
tag="None"
image="None"
mounts=()
umounts() {
for i in "${mounts[@]}"; do
umount $i
echo $mounts
mounts=("${mounts[@]/$i}")
echo $mounts
done
buildah unmount $ctr
trap - 0
}
trap umounts 0
ctr=$(buildah from $base)
mnt=$(buildah mount $ctr)
mounts=("$mnt" "${mounts[@]}")

View File

@ -1,25 +1,21 @@
#/usr/bin/env bash
base="alpine"
repo="None"
tag="None"
image="None"
mounts=()
umounts() {
for i in "${mounts[@]}"; do
umount $i
echo $mounts
mounts=("${mounts[@]/$i}")
echo $mounts
done
buildah unmount $ctr
trap - 0
}
trap umounts 0
ctr=$(buildah from $base)
mnt=$(buildah mount $ctr)
mounts=("$mnt" "${mounts[@]}")
buildah run --user root $ctr -- mkdir -p /var/cache/apk
mkdir -p $(pwd)/.cache/apk
mount -o bind $(pwd)/.cache/apk $mnt/var/cache/apk
mounts=("$mnt/var/cache/apk" "${mounts[@]}")
buildah run $ctr -- ln -s /var/cache/apk /etc/apk/cache
old="$(find .cache/apk/ -name APKINDEX.* -mtime +3)"
if [ -n "$old" ] || ! ls .cache/apk/APKINDEX.*; then

View File

@ -1,25 +1,21 @@
#/usr/bin/env bash
base="alpine"
repo="None"
tag="None"
image="None"
mounts=()
umounts() {
for i in "${mounts[@]}"; do
umount $i
echo $mounts
mounts=("${mounts[@]/$i}")
echo $mounts
done
buildah unmount $ctr
trap - 0
}
trap umounts 0
ctr=$(buildah from $base)
mnt=$(buildah mount $ctr)
mounts=("$mnt" "${mounts[@]}")
buildah run --user root $ctr -- mkdir -p /var/cache/apk
mkdir -p $(pwd)/.cache/apk
mount -o bind $(pwd)/.cache/apk $mnt/var/cache/apk
mounts=("$mnt/var/cache/apk" "${mounts[@]}")
buildah run $ctr -- ln -s /var/cache/apk /etc/apk/cache
old="$(find .cache/apk/ -name APKINDEX.* -mtime +3)"
if [ -n "$old" ] || ! ls .cache/apk/APKINDEX.*; then