Use non-nodejs base image (#384)

This commit is contained in:
Malachi Soord 2024-02-09 09:15:31 +01:00 committed by GitHub
parent 66ff807473
commit 85100fc7b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 14 deletions

View file

@ -11,6 +11,7 @@
"matchStringsStrategy": "any", "matchStringsStrategy": "any",
"matchStrings": [ "matchStrings": [
"ARG BUILD_FROM=(?<depName>.*?):(?<currentValue>.*?)\\s+", "ARG BUILD_FROM=(?<depName>.*?):(?<currentValue>.*?)\\s+",
"ARG BUILDER=(?<depName>.*?):(?<currentValue>.*?)\\s+",
"(aarch64|amd64|armhf|armv7|i386):\\s[\"']?(?<depName>.*?):(?<currentValue>.*?)[\"']?\\s" "(aarch64|amd64|armhf|armv7|i386):\\s[\"']?(?<depName>.*?):(?<currentValue>.*?)[\"']?\\s"
], ],
"datasourceTemplate": "docker" "datasourceTemplate": "docker"

View file

@ -1,12 +1,33 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base-nodejs:0.1.3 ARG BUILD_FROM=ghcr.io/hassio-addons/base:15.0.6
ARG BUILDER=ghcr.io/hassio-addons/base-nodejs:0.1.3
# hadolint ignore=DL3006
FROM ${BUILDER} AS builder
# Setup base
ARG TASMOADMIN_VERSION="v3.3.3"
# hadolint ignore=DL3003
RUN \
apk add --no-cache \
git=2.43.0-r0 \
\
&& git clone --branch "${TASMOADMIN_VERSION}" --depth=1 \
"https://github.com/TasmoAdmin/TasmoAdmin.git" /var/www/tasmoadmin \
\
&& cd /var/www/tasmoadmin/tasmoadmin \
&& npm ci \
&& node minify.js \
&& NODE_ENV=production npm ci
# hadolint ignore=DL3006 # hadolint ignore=DL3006
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
# Set shell # Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Setup base COPY --from=builder /var/www/tasmoadmin/tasmoadmin /var/www/tasmoadmin/tasmoadmin
ARG TASMOADMIN_VERSION="v3.3.3"
# hadolint ignore=DL3003 # hadolint ignore=DL3003
RUN \ RUN \
apk add --no-cache \ apk add --no-cache \
@ -23,18 +44,10 @@ RUN \
\ \
&& apk add --no-cache --virtual .build-dependencies \ && apk add --no-cache --virtual .build-dependencies \
composer=2.7.0-r0 \ composer=2.7.0-r0 \
git=2.43.0-r0 \
\
&& git clone --branch "${TASMOADMIN_VERSION}" --depth=1 \
"https://github.com/TasmoAdmin/TasmoAdmin.git" /var/www/tasmoadmin \
\ \
&& cd /var/www/tasmoadmin/tasmoadmin \ && cd /var/www/tasmoadmin/tasmoadmin \
&& composer install --no-dev \ && composer install --no-dev \
\ \
&& npm ci \
&& node minify.js \
&& NODE_ENV=production npm ci \
\
&& apk del --no-cache --purge .build-dependencies \ && apk del --no-cache --purge .build-dependencies \
\ \
&& rm -f -r \ && rm -f -r \

View file

@ -1,8 +1,8 @@
--- ---
build_from: build_from:
aarch64: ghcr.io/hassio-addons/base-nodejs:0.1.3 aarch64: ghcr.io/hassio-addons/base:15.0.6
amd64: ghcr.io/hassio-addons/base-nodejs:0.1.3 amd64: ghcr.io/hassio-addons/base:15.0.6
armv7: ghcr.io/hassio-addons/base-nodejs:0.1.3 armv7: ghcr.io/hassio-addons/base:15.0.6
codenotary: codenotary:
base_image: codenotary@frenck.dev base_image: codenotary@frenck.dev
signer: codenotary@frenck.dev signer: codenotary@frenck.dev