mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-25 10:11:53 +02:00
New logic
This commit is contained in:
@@ -1,39 +1,44 @@
|
||||
#################
|
||||
# 1 Build Image #
|
||||
#################
|
||||
|
||||
FROM troglobit/inadyn:latest
|
||||
|
||||
# Base system
|
||||
ENV BASHIO_VERSION=0.14.3
|
||||
ARG BUILD_ARCH
|
||||
##################
|
||||
# 2 Modify Image #
|
||||
##################
|
||||
|
||||
ARG BUILD_ARCH
|
||||
ENV LANG='C.UTF-8'\
|
||||
TERM='xterm-256color'\
|
||||
GOPATH='/opt/go'
|
||||
|
||||
##################
|
||||
# 3 Install apps #
|
||||
##################
|
||||
|
||||
# Add rootfs
|
||||
COPY rootfs/ /
|
||||
|
||||
# Manual apps
|
||||
ENV PACKAGES="curl \
|
||||
jq \
|
||||
bash \
|
||||
xz build-base libressl-dev ca-certificates npm"
|
||||
build-base libressl-dev ca-certificates npm"
|
||||
|
||||
RUN \
|
||||
################
|
||||
# Install apps #
|
||||
################
|
||||
apk add --no-cache ${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 \
|
||||
\
|
||||
####################
|
||||
# Install mustache #
|
||||
####################
|
||||
&& apk add --no-cache \
|
||||
# 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
|
||||
|
||||
# Install mustache
|
||||
RUN apk add --no-cache \
|
||||
go \
|
||||
npm \
|
||||
xz \
|
||||
# && npm install mustache-cli --global
|
||||
&& apk upgrade --no-cache &&\
|
||||
apk add --no-cache --virtual .build-deps\
|
||||
@@ -43,19 +48,22 @@ RUN \
|
||||
go get -u github.com/quantumew/mustache-cli &&\
|
||||
cp $GOPATH/bin/* /usr/bin/ && \
|
||||
rm -rf $GOPATH /var/cache/apk/* /tmp/src &&\
|
||||
apk del .build-deps xz build-base
|
||||
apk del .build-deps xz build-base || true
|
||||
|
||||
# Copy root filesystem
|
||||
COPY rootfs /
|
||||
################
|
||||
# 4 Entrypoint #
|
||||
################
|
||||
|
||||
WORKDIR /
|
||||
RUN chmod 777 /run.sh
|
||||
RUN chmod 777 /entrypoint.sh
|
||||
ENTRYPOINT [ "/usr/bin/env" ]
|
||||
CMD [ "/run.sh" ]
|
||||
|
||||
CMD [ "/entrypoint.sh" ]
|
||||
VOLUME [ "/data" ]
|
||||
|
||||
### LABELS
|
||||
############
|
||||
# 5 Labels #
|
||||
############
|
||||
|
||||
ARG BUILD_ARCH
|
||||
ARG BUILD_DATE
|
||||
ARG BUILD_DESCRIPTION
|
||||
|
||||
Reference in New Issue
Block a user