mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 10:21:02 +01:00
New logic
This commit is contained in:
@@ -1,32 +1,18 @@
|
||||
#################
|
||||
# 1 Build Image #
|
||||
#################
|
||||
|
||||
ARG BUILD_FROM
|
||||
ARG BUILD_VERSION
|
||||
FROM wiserain/flexget:latest
|
||||
ENV BASHIO_VERSION=0.14.3
|
||||
|
||||
##################
|
||||
# 2 Modify Image #
|
||||
##################
|
||||
|
||||
RUN \
|
||||
##################
|
||||
# Install apps #
|
||||
##################
|
||||
apk add --no-cache \
|
||||
jq \
|
||||
curl \
|
||||
cifs-utils \
|
||||
\
|
||||
##################
|
||||
# Install bashio #
|
||||
##################
|
||||
&& mkdir -p /tmp/bashio \
|
||||
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
|
||||
| tar -xzf - --strip 1 -C /tmp/bashio \
|
||||
&& mv /tmp/bashio/lib /usr/lib/bashio \
|
||||
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
|
||||
&& rm -rf /tmp/bashio \
|
||||
\
|
||||
###############
|
||||
# Adapt image #
|
||||
###############
|
||||
# Allow UID and GID setting
|
||||
&& sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
|
||||
sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
|
||||
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
|
||||
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser \
|
||||
\
|
||||
@@ -40,9 +26,40 @@ RUN \
|
||||
&& sed -i 's/# set FG_WEBUI_PASSWD/if bashio::config.has_value "WebuiPass"; then FG_WEBUI_PASSWD=$(bashio::config "WebuiPass"); fi/g' /etc/cont-init.d/20-config \
|
||||
&& sed -i 's/# install custom plugins/if bashio::config.has_value "FG_PLUGINS"; then FG_PLUGINS=$(bashio::config "FG_PLUGINS"); fi/g' /etc/cont-init.d/20-config
|
||||
|
||||
VOLUME [ "/data" ]
|
||||
##################
|
||||
# 3 Install apps #
|
||||
##################
|
||||
|
||||
# Add rootfs
|
||||
COPY rootfs/ /
|
||||
|
||||
# Manual apps
|
||||
ENV PACKAGES="jq \
|
||||
curl \
|
||||
cifs-utils"
|
||||
|
||||
# Automatic apps & bashio
|
||||
RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash); fi && \
|
||||
if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl); fi && \
|
||||
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
|
||||
chmod 777 /automatic_packages.sh && \
|
||||
/automatic_packages.sh "${PACKAGES:-}" && \
|
||||
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE]
|
||||
|
||||
################
|
||||
# 4 Entrypoint #
|
||||
################
|
||||
|
||||
#RUN chmod 777 /entrypoint.sh
|
||||
#WORKDIR /
|
||||
#ENTRYPOINT [ "/usr/bin/env" ]
|
||||
#CMD [ "/entrypoint.sh" ]
|
||||
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
############
|
||||
# 5 Labels #
|
||||
############
|
||||
|
||||
### LABELS
|
||||
ARG BUILD_ARCH
|
||||
ARG BUILD_DATE
|
||||
ARG BUILD_DESCRIPTION
|
||||
|
||||
Reference in New Issue
Block a user