diff --git a/.travis.yml b/.travis.yml index ad8dbad0..89ec6f91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,17 +9,20 @@ env: - DOCKER_BUILD=qmcgaw/private-internet-access - MICROBADGER_CODE=tQFy7AxtSUNANPe6aoVChYdsI_I= matrix: + - TARGET_IMAGE=${DOCKER_BUILD} - ARCH=armhf BASE_IMAGE=arm32v6/alpine TARGET_IMAGE=${DOCKER_BUILD}:${ARCH} + QEMU=https://github.com/multiarch/qemu-user-static/releases/download/v3.1.0-3/qemu-arm-static - ARCH=aarch64 BASE_IMAGE=arm64v8/alpine TARGET_IMAGE=${DOCKER_BUILD}:${ARCH} + QEMU=https://github.com/multiarch/qemu-user-static/releases/download/v3.1.0-3/qemu-arm-static script: - set -e - echo "$DOCKER_PASSWORD" | docker login -u qmcgaw --password-stdin - docker run --rm --privileged multiarch/qemu-user-static:register --reset - - docker build -t ${TARGET_IMAGE} --build-arg BASE_IMAGE=${BASE_IMAGE} --build-arg VCF=${TRAVIS_COMMIT} --build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" . + - docker build -t ${TARGET_IMAGE} --build-arg BASE_IMAGE=${BASE_IMAGE} --build-arg QEMU=${QEMU} --build-arg VCF=${TRAVIS_COMMIT} --build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" . - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && docker push ${DOCKER_BUILD} || false' - "curl -X POST https://hooks.microbadger.com/images/${DOCKER_BUILD}/${MICROBADGER_CODE}" \ No newline at end of file diff --git a/.void b/.void new file mode 100644 index 00000000..e69de29b diff --git a/Dockerfile b/Dockerfile index 5e708104..0ff25c93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,11 @@ ARG BASE_IMAGE FROM ${BASE_IMAGE:-alpine}:3.9 +ARG QEMU= ARG BUILD_DATE ARG VCS_REF +# Only installed for ARM devices +ADD .void ${QEMU}? /usr/bin/ LABEL org.label-schema.schema-version="1.0.0-rc1" \ maintainer="quentin.mcgaw@gmail.com" \ org.label-schema.build-date=$BUILD_DATE \ @@ -64,4 +67,5 @@ RUN chown nonrootuser -R /etc/unbound && \ /etc/unbound/root.hints \ /etc/unbound/root.key \ /etc/unbound/unbound.conf \ - /etc/unbound/*.bz2 + /etc/unbound/*.bz2 && \ + rm -f /usr/bin/qemu-arm-static /usr/bin/.void diff --git a/README.md b/README.md index 64db16b9..fe57ee9c 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ modprobe tun ``` -1. **IF YOU HAVE AN ARM DEVICE, depending on your cpu architecture:** replace `qmcgaw/private-internet-access` +1. **ONLY IF YOU HAVE AN ARM DEVICE, depending on your cpu architecture,** replace `qmcgaw/private-internet-access` with either `qmcgaw/private-internet-access:armhf` (32 bit) or `qmcgaw/private-internet-access:aarch64` (64 bit). 1. Launch the container with: @@ -246,6 +246,27 @@ services: # add more volumes etc. ``` +## ARM devices + +If you want to save 3-5MB on the image (because of QEMU), use the following command on +your ARM device: + +- If your architecture is ARMHF (32 bit) + + ```sh + docker build -t qmcgaw/private-internet-access:armhf \ + --build-arg BASE_IMAGE=arm32v6/alpine \ + https://github.com/qdm12/private-internet-access-docker.git + ``` + +- If your architecture is AARCH64 (64 bit) + + ```sh + docker build -t qmcgaw/private-internet-access:aarch64 \ + --build-arg BASE_IMAGE=arm64v8/alpine \ + https://github.com/qdm12/private-internet-access-docker.git + ``` + ## For the paranoids - You can review the code which essential consits in the [Dockerfile](https://github.com/qdm12/private-internet-access-docker/blob/master/Dockerfile) and [entrypoint.sh](https://github.com/qdm12/private-internet-access-docker/blob/master/entrypoint.sh)