mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-24 13:36:29 +01:00
New logic
This commit is contained in:
@@ -1,38 +1,18 @@
|
||||
#################
|
||||
# 1 Build Image #
|
||||
#################
|
||||
|
||||
ARG BUILD_FROM
|
||||
ARG BUILD_VERSION
|
||||
FROM ${BUILD_FROM}
|
||||
|
||||
##################
|
||||
# 2 Modify Image #
|
||||
##################
|
||||
|
||||
# Set shell
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# copy local files
|
||||
COPY root/ /
|
||||
|
||||
ENV BASHIO_VERSION=0.14.3
|
||||
ENV PACKAGES="jq \
|
||||
cifs-utils \
|
||||
keyutils \
|
||||
samba \
|
||||
smbclient"
|
||||
|
||||
RUN \
|
||||
################
|
||||
# Install apps #
|
||||
################
|
||||
apt-get clean \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ${PACKAGES} \
|
||||
\
|
||||
##################
|
||||
# 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 || true
|
||||
|
||||
RUN \
|
||||
#############################
|
||||
# Allow UID and GID setting #
|
||||
@@ -50,14 +30,44 @@ RUN \
|
||||
&& sed -i 's/with-contenv bash/with-contenv bashio/g' /etc/cont-init.d/45-plex-claim \
|
||||
&& sed -i '2iexport PLEX_CLAIM=$(bashio::config "claim")' /etc/cont-init.d/45-plex-claim \
|
||||
&& sed -i '3i[ $PLEX_CLAIM = "Get_from_https://www.plex.tv/claim" ] && bashio::log.warning "Please change the PLEX_CLAIM code from the options" && exit 1 || true' /etc/cont-init.d/45-plex-claim
|
||||
###########
|
||||
# FOLDERS #
|
||||
###########
|
||||
# && files=$(grep -rl '/config' /etc/cont-init.d/*) && echo $files | xargs sed -i 's|/config|/data|g' \
|
||||
# && sed -i "s|/config|/data|g" /defaults/plexmediaserver \
|
||||
# && sed -i '2i cp -vnpr /config /data || true' /etc/cont-init.d/00-banner.sh
|
||||
|
||||
### LABELS
|
||||
|
||||
##################
|
||||
# 3 Install apps #
|
||||
##################
|
||||
|
||||
# Add rootfs
|
||||
COPY rootfs/ /
|
||||
|
||||
# Manual apps
|
||||
ENV PACKAGES="jq \
|
||||
cifs-utils \
|
||||
keyutils \
|
||||
samba \
|
||||
smbclient"
|
||||
|
||||
# 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 #
|
||||
############
|
||||
|
||||
ARG BUILD_ARCH
|
||||
ARG BUILD_DATE
|
||||
ARG BUILD_DESCRIPTION
|
||||
|
||||
Reference in New Issue
Block a user