Update build docker

This commit is contained in:
Alexey Khit
2022-08-24 14:29:39 +03:00
parent 9310343ad3
commit e36123bb19
2 changed files with 12 additions and 11 deletions
+7 -5
View File
@@ -5,16 +5,18 @@ RUN apk add --no-cache git go ffmpeg
ARG BUILD_ARCH ARG BUILD_ARCH
WORKDIR app RUN git clone https://github.com/AlexxIT/go2rtc \
&& cd go2rtc \
RUN git clone https://github.com/AlexxIT/go2rtc . && CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o /usr/local/bin
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath
# https://github.com/home-assistant/docker-base/blob/master/alpine/Dockerfile # https://github.com/home-assistant/docker-base/blob/master/alpine/Dockerfile
RUN if [ "${BUILD_ARCH}" = "aarch64" ]; then BUILD_ARCH="arm64"; \ RUN if [ "${BUILD_ARCH}" = "aarch64" ]; then BUILD_ARCH="arm64"; \
elif [ "${BUILD_ARCH}" = "armv7" ]; then BUILD_ARCH="arm"; fi \ 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 \ && 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 / COPY run.sh /
RUN chmod a+x /run.sh RUN chmod a+x /run.sh
+5 -6
View File
@@ -2,14 +2,13 @@
set +e set +e
# set cwd for go2rtc (for config file, Hass itegration, etc)
cd /config cd /config
while true; do # add the feature to override go2rtc binary from Hass config folder
if [ -x go2rtc ]; then export PATH="/config:$PATH"
./go2rtc
else
/app/go2rtc
fi
while true; do
go2rtc
sleep 5 sleep 5
done done