diff options
author | thewoosterisroot <thewoosterisroot@protonmail.com> | 2020-04-16 19:30:50 +0200 |
---|---|---|
committer | thewoosterisroot <thewoosterisroot@protonmail.com> | 2020-04-16 19:30:50 +0200 |
commit | 72c1c49da357a089598503c94f8b451a281bbf78 (patch) | |
tree | 6149392b5e6782a01bb1500cfe638d6197917ea4 | |
parent | 121686a928029609e46740d78e129d91fae432e5 (diff) | |
download | wekan-72c1c49da357a089598503c94f8b451a281bbf78.tar.gz wekan-72c1c49da357a089598503c94f8b451a281bbf78.tar.bz2 wekan-72c1c49da357a089598503c94f8b451a281bbf78.zip |
Adding dockerfiles for multi-arch builds and manifest.
-rw-r--r-- | Dockerfile.amd64 (renamed from Dockerfile) | 0 | ||||
-rw-r--r-- | Dockerfile.arm64v8 | 77 | ||||
-rw-r--r-- | wekan-dockerfile-manifest.yaml | 11 |
3 files changed, 88 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile.amd64 index 29248ca1..29248ca1 100644 --- a/Dockerfile +++ b/Dockerfile.amd64 diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 new file mode 100644 index 00000000..35440ddc --- /dev/null +++ b/Dockerfile.arm64v8 @@ -0,0 +1,77 @@ +FROM amd64/alpine:3.7 AS builder + +# Set the environment variables for builder +ENV QEMU_VERSION=v4.2.0-6 \ + QEMU_ARCHITECTURE=aarch64 \ + NODE_ARCHITECTURE=linux-arm64 \ + NODE_VERSION=v12.16.1 \ + WEKAN_VERSION=3.96 \ + WEKAN_ARCHITECTURE=arm64 + + # Install dependencies +RUN apk update && apk add ca-certificates outils-sha1 && \ + \ + # Download qemu static for our architecture + wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_VERSION}/qemu-${QEMU_ARCHITECTURE}-static.tar.gz -O - | tar -xz && \ + \ + # Download wekan and shasum + wget https://releases.wekan.team/raspi3/wekan-${WEKAN_VERSION}-${WEKAN_ARCHITECTURE}.zip && \ + wget https://releases.wekan.team/raspi3/SHA256SUMS.txt && \ + # Verify wekan + grep wekan-${WEKAN_VERSION}-${WEKAN_ARCHITECTURE}.zip SHA256SUMS.txt | sha256sum -c - && \ + \ + # Unzip wekan + unzip wekan-${WEKAN_VERSION}-${WEKAN_ARCHITECTURE}.zip && \ + \ + # Download node and shasums + wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-${NODE_ARCHITECTURE}.tar.gz && \ + wget https://nodejs.org/dist/${NODE_VERSION}/SHASUMS256.txt.asc && \ + \ + # Verify nodejs authenticity + grep node-${NODE_VERSION}-${NODE_ARCHITECTURE}.tar.gz SHASUMS256.txt.asc | sha256sum -c - && \ + \ + # Extract node and remove tar.gz + tar xvzf node-${NODE_VERSION}-${NODE_ARCHITECTURE}.tar.gz + +# Build wekan dockerfile +FROM arm64v8/ubuntu:19.10 +LABEL maintainer="wekan" + +# Set the environment variables (defaults where required) +ENV QEMU_ARCHITECTURE=aarch64 \ + NODE_ARCHITECTURE=linux-arm64 \ + NODE_VERSION=v12.16.1 \ + NODE_ENV=production \ + NPM_VERSION=latest \ + WITH_API=true \ + PORT=8080 \ + ROOT_URL=http://localhost \ + MONGO_URL=mongodb://127.0.0.1:27017/wekan + +# Copy qemu-static to image +COPY --from=builder qemu-${QEMU_ARCHITECTURE}-static /usr/bin + +# Copy the app to the image +COPY --from=builder bundle /home/wekan/bundle + +# Copy +COPY --from=builder node-${NODE_VERSION}-${NODE_ARCHITECTURE} /opt/nodejs + +RUN \ + set -o xtrace && \ + # Add non-root user wekan + useradd --user-group --system --home-dir /home/wekan wekan && \ + \ + # Install Node + ln -s /opt/nodejs/bin/node /usr/bin/node && \ + ln -s /opt/nodejs/bin/npm /usr/bin/npm && \ + mkdir -p /opt/nodejs/lib/node_modules/fibers/.node-gyp /root/.node-gyp/8.16.1 /home/wekan/.config && \ + chown wekan --recursive /home/wekan/.config && \ + \ + # Install Node dependencies + npm install -g npm@${NPM_VERSION} + +EXPOSE $PORT +USER wekan + +CMD ["node", "/home/wekan/bundle/main.js"] diff --git a/wekan-dockerfile-manifest.yaml b/wekan-dockerfile-manifest.yaml new file mode 100644 index 00000000..9242f7d7 --- /dev/null +++ b/wekan-dockerfile-manifest.yaml @@ -0,0 +1,11 @@ +image: quay.io/wekan/wekan +manifests: + - image: quay.io/wekan/wekan:amd64 + platform: + architecture: amd64 + os: linux + - image: quay.io/wekan/wekan:arm64v8 + platform: + architecture: arm64 + os: linux + variant: v8 |