Switch to new S6 service configuration (#40)

* Add new service files

* Remove moved file

* Move files

* Add exec perm

* Update for new services

* Remove xz-utils after use

* Check labels

* Move labels to build

* Typo

* List images

* Fixit

* Add super lint

* Update labels

* Whoops

* Remove superlint

* Add teslamate dependency

* Fix url
This commit is contained in:
Colin Seymour
2024-10-27 16:43:53 +00:00
committed by GitHub
parent 3d167fc6ee
commit 86fe972431
16 changed files with 20 additions and 24 deletions
+5 -24
View File
@@ -25,7 +25,6 @@ RUN \
set -x \
&& apt-get update && apt-get install -y --no-install-recommends \
bash \
bind9utils \
ca-certificates \
curl \
jq \
@@ -33,7 +32,6 @@ RUN \
postgresql-client \
tzdata \
xz-utils \
&& rm -rf /var/lib/apt/lists/* \
&& S6_ARCH="${BUILD_ARCH}" \
&& if [ "${BUILD_ARCH}" = "amd64" ]; then S6_ARCH="x86_64"; \
elif [ "${BUILD_ARCH}" = "armv7" ]; then S6_ARCH="arm"; fi \
@@ -41,33 +39,16 @@ RUN \
&& curl -Ls "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz" | tar xpJ -C / \
&& curl -Ls "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz" | tar Jxp -C / \
&& curl -Ls "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz" | tar Jxp -C / \
&& mkdir -p /etc/fix-attrs.d \
&& mkdir -p /etc/services.d \
&& mkdir -p /tmp/bashio \
&& curl -Ls "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | tar xz --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& apt purge -y xz-utils \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio
&& rm -rf /var/lib/apt/lists/* /tmp/*
COPY --chown=root scripts/*.sh /
RUN chmod a+x /*.sh
COPY --chown=root services/teslamate/run services/teslamate/finish /etc/services.d/teslamate/
RUN chmod a+x /etc/services.d/teslamate/*
COPY --chown=root services/nginx/run services/nginx/finish /etc/services.d/nginx/
RUN chmod a+x /etc/services.d/nginx/*
COPY --chown=root services/nginx/teslamate.conf /etc/nginx/conf.d/
COPY --from=grafana --chown=root /dashboards /dashboards
COPY --from=grafana --chown=root /dashboards_internal /dashboards
COPY rootfs /
COPY --from=grafana /dashboards /dashboards
COPY --from=grafana /dashboards_internal /dashboards
# S6-Overlay
ENTRYPOINT ["/init"]
LABEL \
org.opencontainers.image.title="Home Assistant Add-on: TeslaMate" \
org.opencontainers.image.description="A self-hosted data logger for your Tesla." \
org.opencontainers.image.source="https://github.com/lildude/ha-addon-ghostfolio/" \
org.opencontainers.image.licenses="MIT"