Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:blowfish: Adds hooks

Alicia Sykes02459645c3e0
diff --git a/Dockerfile-arm32v7 b/Dockerfile-arm32v7
deleted file mode 100644
index cb50da2b..00000000
--- a/Dockerfile-arm32v7
+++ /dev/null
@@ -1,43 +0,0 @@
-FROM alpine:3.12 AS builder
-
-# Download QEMU, see https://github.com/docker/hub-feedback/issues/1261
-RUN QEMU_URL=https://github.com/balena-io/qemu/releases/download/v5.2.0%2Bbalena4/qemu-5.2.0.balena4-arm.tar.gz \
- && apk add curl && curl -L $QEMU_URL | tar zxvf - -C . --strip-components 1
-
-# Start second (arm32v7) stage
-FROM arm32v7/alpine:3.12
-
-# Add QEMU from build stage
-COPY --from=builder qemu-arm-static /usr/bin
-
-# Install Node and Yarn
-RUN apk add --update --no-cache nodejs npm yarn
-
-# Define some ENV Vars
-ENV PORT=80 \
- DIRECTORY=/app \
- IS_DOCKER=true
-
-# Create and set the working directory
-WORKDIR ${DIRECTORY}
-
-# Copy over both 'package.json' and 'package-lock.json' (if available)
-COPY package*.json ./
-
-# Install project dependencies
-RUN yarn
-
-# Copy over all project files and folders to the working directory
-COPY . .
-
-# Build initial app for production
-RUN yarn build
-
-# Expose given port
-EXPOSE ${PORT}
-
-# Finally, run start command to serve up the built application
-CMD [ "yarn", "build-and-start"]
-
-# Run simple healthchecks every 5 mins, to check the Dashy's everythings great
-HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check
diff --git a/Dockerfile-arm64v8 b/Dockerfile-arm64v8
deleted file mode 100644
index 1d85444b..00000000
--- a/Dockerfile-arm64v8
+++ /dev/null
@@ -1,43 +0,0 @@
-FROM alpine:3.12 AS builder
-
-# Download QEMU, see https://github.com/docker/hub-feedback/issues/1261
-RUN QEMU_URL=https://github.com/balena-io/qemu/releases/download/v5.2.0%2Bbalena4/qemu-5.2.0.balena4-aarch64.tar.gz \
- && apk add curl && curl -L $QEMU_URL | tar zxvf - -C . --strip-components 1
-
-# Start second (arm64v8) stage
-FROM arm64v8/alpine:3.12
-
-# Add QEMU from build stage
-COPY --from=builder qemu-aarch64-static /usr/bin
-
-# Install Node and Yarn
-RUN apk add --update --no-cache nodejs npm yarn
-
-# Define some ENV Vars
-ENV PORT=80 \
- DIRECTORY=/app \
- IS_DOCKER=true
-
-# Create and set the working directory
-WORKDIR ${DIRECTORY}
-
-# Copy over both 'package.json' and 'package-lock.json' (if available)
-COPY package*.json ./
-
-# Install project dependencies
-RUN yarn
-
-# Copy over all project files and folders to the working directory
-COPY . .
-
-# Build initial app for production
-RUN yarn build
-
-# Expose given port
-EXPOSE ${PORT}
-
-# Finally, run start command to serve up the built application
-CMD [ "yarn", "build-and-start"]
-
-# Run simple healthchecks every 5 mins, to check the Dashy's everythings great
-HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check
diff --git a/docker/hooks/pre_build b/docker/hooks/pre_build
new file mode 100644
index 00000000..b0621283
--- /dev/null
+++ b/docker/hooks/pre_build
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Source: https://github.com/ckulka/docker-multi-arch-example/blob/master/hooks/pre_build
+# Used to setup QEMU to build arm images on amd64 processors.
+
+# Register qemu-*-static for all supported processors except the
+# current one, but also remove all registered binfmt_misc before
+docker run --rm --privileged multiarch/qemu-user-static:register --reset