This commit is contained in:
IamTheFij 2019-03-08 16:44:47 -08:00
parent 701027cc9c
commit 2944ffb8c8
4 changed files with 21 additions and 9 deletions

4
.gitignore vendored
View File

@ -1,4 +1,2 @@
qemu-aarch64-static
qemu-arm-static
qemu-x86_64-static
qemu-*
*.tar.gz

View File

@ -2,7 +2,7 @@ ARG REPO=library
FROM ${REPO}/python:3-alpine
ARG ARCH=x86_64
COPY ./qemu-${ARCH}-static /usr/bin/
COPY ./build/qemu-${ARCH}-static /usr/bin/
RUN mkdir -p /src

View File

@ -1,24 +1,35 @@
DOCKER_TAG ?= cloudflare-ddns-dev-${USER}
.PHONY: default
default: test
.PHONY:test
test:
@echo ok
.PHONY: update
update:
curl -o update_ddns.py https://raw.githubusercontent.com/cloudflare/python-cloudflare/master/examples/example_update_dynamic_dns.py
chmod +x update_ddns.py
build:
.PHONY: build
build: build/qemu-x86_64-static
docker build . -t ${DOCKER_TAG}
build/qemu-arm-static:
mkdir -p build
wget -N https://github.com/multiarch/qemu-user-static/releases/download/v2.9.1-1/x86_64_qemu-${target_arch}-static.tar.gz
tar -xvf x86_64_qemu-${target_arch}-static.tar.gz
./get_qemu.sh
cross-build-arm32v6:
build/qemu-x86_64-static:
./get_qemu.sh
build/qemu-aarch64-static:
./get_qemu.sh
.PHONY: cross-build-arm32v6
cross-build-arm32v6: build/qemu-arm-static
docker build --build-arg REPO=arm32v6 --build-arg ARCH=arm . -t ${DOCKER_TAG}-arm32v6
.PHONY: run
run: build
docker run --rm -e DOMAIN=${DOMAIN} \
-e CF_API_EMAIL=${CF_API_EMAIL} \

View File

@ -3,6 +3,9 @@
HOST_ARCH=x86_64
VERSION=v2.9.1-1
mkdir -p build
cd build
for target_arch in aarch64 arm x86_64; 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