This commit is contained in:
parent
dac43860a5
commit
122523e9cd
10
Dockerfile
10
Dockerfile
@ -2,8 +2,16 @@ ARG REPO=library
|
||||
FROM ${REPO}/python:3-alpine
|
||||
|
||||
ARG ARCH=x86_64
|
||||
COPY ./build/qemu-${ARCH}-static /usr/bin/
|
||||
ARG HOST_ARCH=x86_64
|
||||
|
||||
ARG QEMU_VERSION=v2.9.1-1
|
||||
|
||||
RUN [ $ARCH == $HOST_ARCH ] || { \
|
||||
wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_VERSION}/${HOST_ARCH}_qemu-${ARCH}-static.tar.gz && \
|
||||
tar -xvf ${HOST_ARCH}_qemu-${ARCH}-static.tar.gz && \
|
||||
rm ${HOST_ARCH}_qemu-${ARCH}-static.tar.gz && \
|
||||
mv qemu-${ARCH}-static /usr/bin/ ; \
|
||||
}
|
||||
|
||||
RUN echo "OK" > /foo
|
||||
|
||||
|
4
Makefile
4
Makefile
@ -8,7 +8,7 @@ test:
|
||||
@echo ok
|
||||
|
||||
.PHONY: build
|
||||
build: build/qemu-x86_64-static
|
||||
build:
|
||||
docker build . -t ${DOCKER_TAG}
|
||||
|
||||
build/qemu-arm-static:
|
||||
@ -21,7 +21,7 @@ build/qemu-aarch64-static:
|
||||
./get_qemu.sh
|
||||
|
||||
.PHONY: cross-build-arm
|
||||
cross-build-arm: build/qemu-arm-static
|
||||
cross-build-arm:
|
||||
docker build --build-arg REPO=arm32v6 --build-arg ARCH=arm . -t ${DOCKER_TAG}-arm32v6
|
||||
|
||||
.PHONY: run
|
||||
|
14
get_qemu2.sh
Executable file
14
get_qemu2.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#! /bin/bash
|
||||
|
||||
HOST_ARCH=x86_64
|
||||
VERSION=v2.9.1-1
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
for target_arch in $*; do
|
||||
wget -N https://github.com/multiarch/qemu-user-static/releases/download/$VERSION/${HOST_ARCH}_qemu-${target_arch}-static.tar.gz
|
||||
tar -xvf ${HOST_ARCH}_qemu-${target_arch}-static.tar.gz
|
||||
rm ${HOST_ARCH}_qemu-${target_arch}-static.tar.gz
|
||||
mv qemu-${target_arch}-static /usr/bin/
|
||||
done
|
Loading…
Reference in New Issue
Block a user