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-*
qemu-arm-static
qemu-x86_64-static
*.tar.gz *.tar.gz

View File

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

View File

@ -1,24 +1,35 @@
DOCKER_TAG ?= cloudflare-ddns-dev-${USER} DOCKER_TAG ?= cloudflare-ddns-dev-${USER}
.PHONY: default
default: test default: test
.PHONY:test
test: test:
@echo ok @echo ok
.PHONY: update
update: update:
curl -o update_ddns.py https://raw.githubusercontent.com/cloudflare/python-cloudflare/master/examples/example_update_dynamic_dns.py curl -o update_ddns.py https://raw.githubusercontent.com/cloudflare/python-cloudflare/master/examples/example_update_dynamic_dns.py
chmod +x update_ddns.py chmod +x update_ddns.py
build: .PHONY: build
build: build/qemu-x86_64-static
docker build . -t ${DOCKER_TAG} docker build . -t ${DOCKER_TAG}
build/qemu-arm-static: build/qemu-arm-static:
mkdir -p build ./get_qemu.sh
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
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 docker build --build-arg REPO=arm32v6 --build-arg ARCH=arm . -t ${DOCKER_TAG}-arm32v6
.PHONY: run
run: build run: build
docker run --rm -e DOMAIN=${DOMAIN} \ docker run --rm -e DOMAIN=${DOMAIN} \
-e CF_API_EMAIL=${CF_API_EMAIL} \ -e CF_API_EMAIL=${CF_API_EMAIL} \

View File

@ -3,6 +3,9 @@
HOST_ARCH=x86_64 HOST_ARCH=x86_64
VERSION=v2.9.1-1 VERSION=v2.9.1-1
mkdir -p build
cd build
for target_arch in aarch64 arm x86_64; do 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 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 tar -xvf ${HOST_ARCH}_qemu-${target_arch}-static.tar.gz