home-assistant-apps/cookcli/Dockerfile
2026-09-20 12:02:27 +02:00

49 lines
1.4 KiB
Docker

# Utilise l'image de base Home Assistant
ARG BUILD_FROM
FROM ${BUILD_FROM}
# Installation des dépendances
RUN apk add --no-cache \
coreutils \
util-linux \
procps \
net-tools \
findutils \
grep \
sed \
curl \
wget \
bash \
git \
openssh-client \
nginx \
nginx-mod-stream \
socat \
file
# Détection de l'architecture et téléchargement de la bonne version
RUN ARCH=$(uname -m) && \
case "${ARCH}" in \
x86_64) COOK_ARCH="x86_64-unknown-linux-musl" ;; \
aarch64) COOK_ARCH="aarch64-unknown-linux-musl" ;; \
armv7l) COOK_ARCH="arm-unknown-linux-musleabihf" ;; \
armv6l) COOK_ARCH="arm-unknown-linux-musleabihf" ;; \
*) COOK_ARCH="i686-unknown-linux-musl" ;; \
esac && \
echo "Téléchargement de CookCLI pour l'architecture: ${COOK_ARCH}" && \
curl -L "https://github.com/cooklang/CookCLI/releases/latest/download/cook-${COOK_ARCH}.tar.gz" | tar xz && \
mv cook /usr/local/bin/ && \
chmod a+x /usr/local/bin/cook && \
# Vérification du binaire
file /usr/local/bin/cook && \
/usr/local/bin/cook --version
# Copie des fichiers
COPY rootfs /
# Rendre tous les scripts exécutables
RUN find /etc -name "run" -type f -exec chmod +x {} \; \
&& find /etc -name "*.sh" -type f -exec chmod +x {} \; \
&& find /usr -name "*.sh" -type f -exec chmod +x {} \;
ENTRYPOINT ["/init"]