addon-base-nodejs/base/Dockerfile
renovate[bot] 0416294734
⬆️ Update alpine_3_19/curl to v8.12.0-r0 (#34)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-08 04:52:23 +00:00

120 lines
4.2 KiB
Docker

ARG BUILD_FROM=node:18.20.5-alpine3.19
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
# Environment variables
ENV \
CARGO_NET_GIT_FETCH_WITH_CLI=true \
HOME="/root" \
LANG="C.UTF-8" \
PIP_BREAK_SYSTEM_PACKAGES=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_EXTRA_INDEX_URL="https://wheels.home-assistant.io/musllinux-index/" \
PIP_NO_CACHE_DIR=1 \
PIP_PREFER_BINARY=1 \
PS1="$(whoami)@$(hostname):$(pwd)$ " \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_CMD_WAIT_FOR_SERVICES=1 \
YARN_HTTP_TIMEOUT=1000000 \
TERM="xterm-256color"
# Set shell
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
# Install base system
ARG BUILD_ARCH=amd64
ARG BASHIO_VERSION="v0.16.2"
ARG S6_OVERLAY_VERSION="3.2.0.2"
ARG TEMPIO_VERSION="2024.11.2"
RUN \
set -o pipefail \
\
&& apk add --no-cache --virtual .build-dependencies \
tar=1.35-r2 \
xz=5.4.5-r0 \
\
&& apk add --no-cache \
libcrypto3=3.1.7-r1 \
libssl3=3.1.7-r1 \
musl-utils=1.2.4_git20230717-r4 \
musl=1.2.4_git20230717-r4 \
libstdc++=13.2.1_git20231014-r0 \
\
&& apk add --no-cache \
bash=5.2.21-r0 \
curl=8.12.0-r0 \
jq=1.7.1-r0 \
tzdata=2024b-r0 \
\
&& S6_ARCH="${BUILD_ARCH}" \
&& if [ "${BUILD_ARCH}" = "i386" ]; then S6_ARCH="i686"; \
elif [ "${BUILD_ARCH}" = "amd64" ]; then S6_ARCH="x86_64"; \
elif [ "${BUILD_ARCH}" = "armv7" ]; then S6_ARCH="arm"; fi \
\
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" \
| tar -C / -Jxpf - \
\
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz" \
| tar -C / -Jxpf - \
\
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz" \
| tar -C / -Jxpf - \
\
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz" \
| tar -C / -Jxpf - \
\
&& curl -J -L -o /tmp/bashio.tar.gz \
"https://github.com/hassio-addons/bashio/archive/${BASHIO_VERSION}.tar.gz" \
&& mkdir /tmp/bashio \
&& tar zxvf \
/tmp/bashio.tar.gz \
--strip 1 -C /tmp/bashio \
\
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
\
&& curl -L -s -o /usr/bin/tempio \
"https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}" \
&& chmod a+x /usr/bin/tempio \
\
&& apk del --no-cache --purge .build-dependencies \
&& rm -f -r \
/tmp/*
# Copy root filesystem
COPY rootfs /
# Copy s6-overlay adjustments
COPY s6-overlay /package/admin/s6-overlay-${S6_OVERLAY_VERSION}/
# Entrypoint & CMD
ENTRYPOINT ["/init"]
# Build arugments
ARG BUILD_DATE
ARG BUILD_REF
ARG BUILD_VERSION
ARG BUILD_REPOSITORY
# Labels
LABEL \
io.hass.name="Addon NodeJS base for ${BUILD_ARCH}" \
io.hass.description="Home Assistant Community Add-on: ${BUILD_ARCH} NodeJS base image" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="base" \
io.hass.version=${BUILD_VERSION} \
maintainer="Franck Nijhof <frenck@addons.community>" \
org.opencontainers.image.title="Addon NodeJS base for ${BUILD_ARCH}" \
org.opencontainers.image.description="Home Assistant Community Add-on: ${BUILD_ARCH} NodeJS base image" \
org.opencontainers.image.vendor="Home Assistant Community Add-ons" \
org.opencontainers.image.authors="Franck Nijhof <frenck@addons.community>" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.url="https://addons.community" \
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}