Skip to content

Commit

Permalink
Modify Dockerfile to allow docker cross build
Browse files Browse the repository at this point in the history
Provide Readme.armhf with short instructions
  • Loading branch information
ofthesun9 committed Apr 3, 2020
1 parent 4e04ec6 commit 74b0dc2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
FROM nginx:1.17.3
ARG DIST=nginx:1.17.3
FROM $DIST
ARG ARCH=amd64

WORKDIR /root

ENV S6_OVERLAY_VERSION v1.22.1.0
ENV DOCKER_GEN_VERSION 0.7.4
ENV ACME_TINY_VERSION 4.1.0

ADD https://github.com/just-containers/s6-overlay/releases/download/$S6_OVERLAY_VERSION/s6-overlay-amd64.tar.gz /tmp/
ADD https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz /tmp/
ADD https://github.com/just-containers/s6-overlay/releases/download/$S6_OVERLAY_VERSION/s6-overlay-$ARCH.tar.gz /tmp/
ADD https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-$ARCH-$DOCKER_GEN_VERSION.tar.gz /tmp/
ADD https://raw.githubusercontent.com/diafygi/acme-tiny/$ACME_TINY_VERSION/acme_tiny.py /bin/acme_tiny

RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / &&\
tar -C /bin -xzf /tmp/docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz && \
rm /tmp/docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz && \
rm /tmp/s6-overlay-amd64.tar.gz && \
RUN tar xzf /tmp/s6-overlay-$ARCH.tar.gz -C / &&\
tar -C /bin -xzf /tmp/docker-gen-linux-${ARCH}-$DOCKER_GEN_VERSION.tar.gz && \
rm /tmp/docker-gen-linux-$ARCH-$DOCKER_GEN_VERSION.tar.gz && \
rm /tmp/s6-overlay-$ARCH.tar.gz && \
rm /etc/nginx/conf.d/default.conf && \
apt-get update && \
apt-get install -y python ruby cron iproute2 apache2-utils && \
Expand Down
5 changes: 5 additions & 0 deletions Readme.armhf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#to build armhf image from amd64 machine:
#Install qemu, see https://github.com/multiarch/qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
#Pass relevant args to the docker build cmd
docker build --build-arg DIST=arm32v7/nginx:1.17.3 --build-arg ARCH=armhf -t https-portal:armhf-master .

0 comments on commit 74b0dc2

Please sign in to comment.