Download qemu in container
continuous-integration/drone/push Build is failing Details

This commit is contained in:
IamTheFij 2019-03-10 15:00:31 -07:00
parent dac43860a5
commit 122523e9cd
3 changed files with 25 additions and 3 deletions

View File

@ -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

View File

@ -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
View 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