From 0e7b8222d38b435fbf5ebbb8ac1b48b18da8058c Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 24 Apr 2024 17:46:18 +0200 Subject: [PATCH] Update Dockerfile --- zzz_draft_birdnet-pi/Dockerfile | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/zzz_draft_birdnet-pi/Dockerfile b/zzz_draft_birdnet-pi/Dockerfile index 345506169..9423a696f 100644 --- a/zzz_draft_birdnet-pi/Dockerfile +++ b/zzz_draft_birdnet-pi/Dockerfile @@ -45,19 +45,27 @@ RUN \ # Avoid rebooting at end of installation sed -i "/reboot/d" /newinstaller.sh && \ # Use apt-get as without user action - sed -i "s|apt |apt-get |g" /newinstaller.sh - -USER abc -WORKDIR /app -RUN export DEBIAN_FRONTEND noninteractive && \ - export BIRDNET_USER="abc" && \ - export USER="abc" && \ - export HOME="/app" && \ - echo "HOME is $HOME" && \ - ls -l /app && \ - sudo chown -R abc:abc /app && \ + sed -i "s|apt |apt-get |g" /newinstaller.sh && \ + \ + # Remove all instances of sudo from the newinstaller + sed -i -e "s|== 0|== 7|g" -e "s|sudo -n true|true|g" -e "s|sudo -K|true|g" /newinstaller.sh && \ + # Remove all instances of sudo from all other scripts + sed -i '1a for file in $(grep -srl "sudo" $HOME/BirdNET-Pi/scripts); do \sed -i "s|sudo ||" "$file"; done' /newinstaller.sh && \ + \ /./newinstaller.sh -USER root + + +#USER abc +#WORKDIR /app +#RUN export DEBIAN_FRONTEND noninteractive && \ +# export BIRDNET_USER="abc" && \ +# export USER="abc" && \ +# export HOME="/app" && \ +# echo "HOME is $HOME" && \ +# ls -l /app && \ +# sudo chown -R abc:abc /app && \ +# /./newinstaller.sh +#USER root #sudo -E -u birdnet -s /bin/bash -c "/newinstaller.sh" # Correct script #sed -i "s|== 0|== 7|g" /newinstaller.sh && \