Clean bashio code

This commit is contained in:
Alexandre
2021-10-23 22:45:38 +02:00
parent e3c741d315
commit 3a54fe2b6c
14 changed files with 19 additions and 41 deletions

View File

@@ -25,10 +25,7 @@ RUN \
| tar -xzf - --strip 1 -C /tmp/bashio \ | tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \ && mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \ && rm -rf /tmp/bashio
\
/var/{cache,log}/* \
/var/lib/apt/lists/*
# Copy root filesystem # Copy root filesystem
COPY rootfs / COPY rootfs /

View File

@@ -17,11 +17,6 @@ RUN apt-get update \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \ && rm -rf /tmp/bashio \
\ \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -fr \
/tmp/* \
/var/lib/apt/lists/* \
# Allow UID and GID setting # 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/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \

View File

@@ -19,12 +19,6 @@ RUN apt-get update \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \ && rm -rf /tmp/bashio \
\ \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -fr \
/tmp/* \
/var/lib/apt/lists/* \
\
# Allow UID and GID setting # 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/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \

View File

@@ -30,9 +30,6 @@ RUN \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \ && rm -rf /tmp/bashio \
\ \
/var/{cache,log}/* \
/var/lib/apt/lists/* \
\
############################# #############################
# Allow UID and GID setting # # Allow UID and GID setting #
############################# #############################

View File

@@ -22,12 +22,6 @@ RUN \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \ && rm -rf /tmp/bashio \
\ \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -fr \
/tmp/* \
/var/lib/apt/lists/* \
\
############### ###############
# Adapt image # # Adapt image #
############### ###############

View File

@@ -3,7 +3,11 @@ ARG BUILD_VERSION
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
ARG BASHIO_VERSION=0.13.1 ARG BASHIO_VERSION=0.13.1
RUN curl -J -L -o /tmp/bashio.tar.gz \ RUN \
##################
# Install bashio #
##################
curl -J -L -o /tmp/bashio.tar.gz \
"https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \ "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
&& mkdir /tmp/bashio \ && mkdir /tmp/bashio \
&& tar zxvf \ && tar zxvf \

View File

@@ -25,10 +25,6 @@ RUN apt-get update \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \ && rm -rf /tmp/bashio \
\ \
&& rm -fr \
/tmp/* \
/var/{cache,log}/* \
/var/lib/apt/lists/* \
# Allow UID and GID setting # 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/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \

View File

@@ -17,7 +17,9 @@ RUN \
wget \ wget \
jq \ jq \
nginx \ nginx \
#Install bashio ##################
# Install bashio #
##################
&& curl -J -L -o /tmp/bashio.tar.gz \ && curl -J -L -o /tmp/bashio.tar.gz \
"https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \ "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
&& mkdir /tmp/bashio \ && mkdir /tmp/bashio \

View File

@@ -11,7 +11,9 @@ ARG BASHIO_VERSION=0.13.1
# Add bashio # Add bashio
RUN \ RUN \
echo "Install version $BUILD_VERSION on $BUILD_ARCH" \ echo "Install version $BUILD_VERSION on $BUILD_ARCH" \
#Install bashio ##################
# Install bashio #
##################
&& echo "**** Install Bashio ****" \ && echo "**** Install Bashio ****" \
&& apk add --no-cache \ && apk add --no-cache \
curl jq \ curl jq \

View File

@@ -19,7 +19,7 @@ RUN \
samba \ samba \
smbclient \ smbclient \
\ \
################### ##################
# Install bashio # # Install bashio #
################## ##################
&& mkdir -p /tmp/bashio \ && mkdir -p /tmp/bashio \

View File

@@ -33,9 +33,6 @@ RUN \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \ && rm -rf /tmp/bashio \
\ \
/var/{cache,log}/* \
/var/lib/apt/lists/* \
\
################### ###################
# Configure image # # Configure image #
################### ###################

View File

@@ -32,9 +32,6 @@ RUN \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \ && rm -rf /tmp/bashio \
\ \
/var/{cache,log}/* \
/var/lib/apt/lists/* \
\
############################# #############################
# Allow UID and GID setting # # Allow UID and GID setting #
############################# #############################

View File

@@ -17,7 +17,7 @@ RUN \
samba \ samba \
smbclient \ smbclient \
\ \
################### ##################
# Install bashio # # Install bashio #
################## ##################
&& mkdir -p /tmp/bashio \ && mkdir -p /tmp/bashio \

View File

@@ -26,13 +26,16 @@ RUN \
"https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}" \ "https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}" \
&& chmod a+x /usr/bin/tempio \ && chmod a+x /usr/bin/tempio \
\ \
# Install bashio ##################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \ && mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \ && curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \ | tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \ && mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \ && rm -rf /tmp/bashio \
\
# Allow UID and GID setting # 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/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \