From e36123bb1937bd87281c95da27b47ba346fe2895 Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Wed, 24 Aug 2022 14:29:39 +0300 Subject: [PATCH] Update build docker --- build/hassio/Dockerfile | 12 +++++++----- build/hassio/run.sh | 11 +++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/build/hassio/Dockerfile b/build/hassio/Dockerfile index 4a1eac59..ce60ff35 100644 --- a/build/hassio/Dockerfile +++ b/build/hassio/Dockerfile @@ -5,16 +5,18 @@ RUN apk add --no-cache git go ffmpeg ARG BUILD_ARCH -WORKDIR app - -RUN git clone https://github.com/AlexxIT/go2rtc . -RUN CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath +RUN git clone https://github.com/AlexxIT/go2rtc \ + && cd go2rtc \ + && CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o /usr/local/bin # https://github.com/home-assistant/docker-base/blob/master/alpine/Dockerfile RUN if [ "${BUILD_ARCH}" = "aarch64" ]; then BUILD_ARCH="arm64"; \ elif [ "${BUILD_ARCH}" = "armv7" ]; then BUILD_ARCH="arm"; fi \ + && cd go2rtc \ && curl $(curl -s "https://raw.githubusercontent.com/ngrok/docker-ngrok/main/releases.json" | jq -r ".${BUILD_ARCH}.url") -o ngrok.zip \ - && unzip ngrok + && unzip ngrok -d /usr/local/bin + +RUN rm -r /go2rtc COPY run.sh / RUN chmod a+x /run.sh diff --git a/build/hassio/run.sh b/build/hassio/run.sh index 35c97b25..e8c96900 100644 --- a/build/hassio/run.sh +++ b/build/hassio/run.sh @@ -2,14 +2,13 @@ set +e +# set cwd for go2rtc (for config file, Hass itegration, etc) cd /config -while true; do - if [ -x go2rtc ]; then - ./go2rtc - else - /app/go2rtc - fi +# add the feature to override go2rtc binary from Hass config folder +export PATH="/config:$PATH" +while true; do + go2rtc sleep 5 done \ No newline at end of file