Files
linuxkit/alpine/containers/binfmt/Makefile
Justin Cormack 6e82b2ad54 Use riddler to generate config.json
- use jq to fix up the output where there are still issues
- some issues will need fixing up in future too
- can remove fixes later
- still plan to restructure the code around containers to make it easier and clearer

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-01-10 22:03:13 +00:00

31 lines
1.2 KiB
Makefile

# Tag 7a07de557d7f6ae3d72873c32bfb4c51c7687d03
QEMU_IMAGE=mobylinux/qemu-user-static@sha256:cbeba25809c7c3feebc9e20522145e33d8abe5956674afa52814fc57c6644497
QEMU_BINARIES=qemu-arm-static qemu-aarch64-static qemu-ppc64le-static
default: config.json
$(QEMU_BINARIES):
docker run --rm --net=none $(QEMU_IMAGE) tar cf - -C /usr/bin $@ | tar xf -
EXCLUDE=--exclude .dockerenv --exclude Dockerfile \
--exclude dev/console --exclude dev/pts --exclude dev/shm \
--exclude etc/hostname --exclude etc/hosts --exclude etc/mtab --exclude etc/resolv.conf
config.json: Dockerfile main.go 00_moby.conf $(QEMU_BINARIES)
mkdir -p rootfs
BUILD=$$( tar cf - $^ | docker build -q - ) && \
[ -n "$$BUILD" ] && \
echo "Built $$BUILD" && \
IMAGE=$$( docker run --rm --net=none $$BUILD | docker build -q - ) && \
[ -n "$$IMAGE" ] && \
echo "Built $$IMAGE" && \
CONTAINER=$$( docker create $$IMAGE /dev/null ) && \
docker export $$CONTAINER | tar -xf - -C rootfs $(EXCLUDE) && \
docker rm $$CONTAINER && \
../riddler.sh --cap-drop all --read-only -v /proc/sys/fs/binfmt_misc:/binfmt_misc $$IMAGE /usr/bin/binfmt -dir /etc/binfmt.d/ -mount /binfmt_misc >$@
clean:
rm -rf rootfs config.json $(QEMU_BINARIES)
.DELETE_ON_ERROR: