2022-08-03 09:29:06 +02:00
|
|
|
ARG BUILD_FROM=ghcr.io/hassio-addons/base/amd64:12.2.2
|
2019-12-19 15:08:47 +01:00
|
|
|
FROM ${BUILD_FROM}
|
|
|
|
|
|
|
|
# Copy root filesystem
|
2021-02-10 16:38:34 +01:00
|
|
|
COPY rootfs/etc /etc/
|
|
|
|
COPY rootfs/usr /usr/
|
2019-12-19 15:08:47 +01:00
|
|
|
|
|
|
|
# Setup base
|
2022-05-01 15:52:34 +02:00
|
|
|
RUN apk add --no-cache nodejs-current
|
|
|
|
|
|
|
|
# Fix for arm/v7
|
|
|
|
RUN mkdir -p /usr/local/sbin/
|
|
|
|
RUN ln -s /usr/bin/node /usr/local/sbin/node
|
2019-12-19 15:08:47 +01:00
|
|
|
|
2021-02-10 16:38:34 +01:00
|
|
|
# Copy only package*.json
|
|
|
|
COPY rootfs/opt/nextcloud_backup/package*.json /opt/nextcloud_backup/
|
2022-05-01 14:13:21 +02:00
|
|
|
COPY rootfs/opt/nextcloud_backup/.yarnrc.yml /opt/nextcloud_backup/
|
2022-05-04 11:01:01 +02:00
|
|
|
COPY rootfs/opt/nextcloud_backup/.yarn/releases/* /opt/nextcloud_backup/.yarn/releases/
|
2021-02-10 16:38:34 +01:00
|
|
|
|
|
|
|
WORKDIR /opt/nextcloud_backup/
|
|
|
|
|
2022-05-01 14:13:21 +02:00
|
|
|
# Enable Yarn
|
|
|
|
RUN corepack enable
|
|
|
|
|
2021-02-10 16:38:34 +01:00
|
|
|
# Install packages
|
2022-05-01 14:13:21 +02:00
|
|
|
RUN yarn install
|
2019-12-19 15:08:47 +01:00
|
|
|
|
2021-02-10 16:38:34 +01:00
|
|
|
# Copy all source code
|
|
|
|
COPY rootfs/opt/ /opt/
|
|
|
|
|
2019-12-19 15:08:47 +01:00
|
|
|
# Build arguments
|
|
|
|
ARG BUILD_ARCH
|
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG BUILD_REF
|
|
|
|
ARG BUILD_VERSION
|
2021-02-10 15:54:40 +01:00
|
|
|
ARG IMAGE_SOURCE
|
2019-12-19 15:08:47 +01:00
|
|
|
|
|
|
|
# Labels
|
|
|
|
LABEL \
|
|
|
|
io.hass.name="Nextcloud Backup" \
|
|
|
|
io.hass.description="Addon that backup your snapshot to a Nextcloud server" \
|
|
|
|
io.hass.arch="${BUILD_ARCH}" \
|
|
|
|
io.hass.type="addon" \
|
|
|
|
io.hass.version=${BUILD_VERSION} \
|
|
|
|
maintainer="Sebclem" \
|
|
|
|
org.label-schema.description="Addon that backup your snapshot to a Nextcloud server" \
|
|
|
|
org.label-schema.build-date=${BUILD_DATE} \
|
|
|
|
org.label-schema.name="Nextcloud Backup" \
|
|
|
|
org.label-schema.schema-version="1.0" \
|
|
|
|
org.label-schema.url="https://addons.community" \
|
|
|
|
org.label-schema.usage="https://github.com/hassio-addons/addon-example/tree/master/README.md" \
|
|
|
|
org.label-schema.vcs-ref=${BUILD_REF} \
|
|
|
|
org.label-schema.vcs-url="https://github.com/hassio-addons/addon-example" \
|
2021-02-10 15:54:40 +01:00
|
|
|
org.label-schema.vendor="Sebclem"\
|
|
|
|
org.opencontainers.image.source=${IMAGE_SOURCE}
|