From 9d170b379ead7e83fa498241416b7adc903f657a Mon Sep 17 00:00:00 2001 From: mammo0 Date: Tue, 13 Nov 2018 13:35:29 +0100 Subject: [PATCH] added a Dockerfile for the automated builds of Docker Hub --- Dockerfile.automated | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Dockerfile.automated diff --git a/Dockerfile.automated b/Dockerfile.automated new file mode 100644 index 000000000..db8f94d95 --- /dev/null +++ b/Dockerfile.automated @@ -0,0 +1,40 @@ +FROM resin/armv7hf-debian-qemu AS armBin + + +FROM arm32v6/node:8-alpine as builder +WORKDIR /usr/src/app +COPY --from=armBin /usr/bin/cross-build-start /usr/bin/ +COPY --from=armBin /usr/bin/cross-build-end /usr/bin/ +COPY --from=armBin /usr/bin/qemu-arm-static /usr/bin/ +COPY --from=armBin /usr/bin/resin-xbuild /usr/bin/ +RUN [ "cross-build-start" ] +RUN apk add --update build-base python +COPY . /usr/src/app +RUN yarn +RUN [ "cross-build-end" ] + + +FROM arm32v6/node:8-alpine +MAINTAINER butlerx@notthe.cloud +MAINTAINER marc.ammon@fau.de + +ENV PORT=3000 +ENV SSHHOST=localhost +ENV SSHPORT=22 + +WORKDIR /app +COPY --from=armBin /usr/bin/cross-build-start /usr/bin/ +COPY --from=armBin /usr/bin/cross-build-end /usr/bin/ +COPY --from=armBin /usr/bin/qemu-arm-static /usr/bin/ +COPY --from=armBin /usr/bin/resin-xbuild /usr/bin/ +RUN [ "cross-build-start" ] +RUN adduser -D -h /home/term -s /bin/sh term && \ + ( echo "term:term" | chpasswd ) && \ + apk add openssh-client && \ + apk add sshpass +USER term +EXPOSE $PORT +COPY --from=builder /usr/src/app /app +RUN mkdir ~/.ssh +RUN [ "cross-build-end" ] +CMD ssh-keyscan -H wetty-ssh >> ~/.ssh/known_hosts && node bin