Commit 80240c99 authored by Markus Frosch's avatar Markus Frosch 📣
Browse files

debootstrap: Embed qemu-user-static into container

parent c04ea58c
Pipeline #3001 passed with stage
in 6 minutes and 3 seconds
......@@ -6,5 +6,6 @@ RUN apt-get update \
COPY debootstrap.sh /usr/local/sbin/
COPY script-raspbian /usr/share/debootstrap/scripts/raspbian
COPY qemu-arm-static /usr/bin/qemu-arm-static
CMD ["debootstrap.sh"]
......@@ -23,6 +23,7 @@ pull:
docker pull "$(FROM)"
build:
cp -av /usr/bin/qemu-arm-static .
docker build --cache-from "$(IMAGE)" --tag "$(IMAGE)" .
tarball: rootfs.tar.xz
......
......@@ -14,20 +14,8 @@ if [ -t 1 ] && [ -t 0 ]; then
opts=-t
fi
if [ ! -x /usr/bin/qemu-arm-static ]; then
echo "Missing /usr/bin/qemu-arm-static to forward it inside the next container!" >&2
exit 1
fi
# make a copy to avoid bind mount problems with dind
qemu="$(mktemp)"
cp -av /usr/bin/qemu-arm-static "$qemu"
docker run -i $opts --rm \
--privileged \
-e "TARBALL=$TARBALL" \
-v "${qemu}:/usr/bin/qemu-arm-static:ro" \
-v "$(pwd):/work" -w "/work" \
"$IMAGE" "$@"
rm -f "${qemu}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment