Update Dockerfile
All checks were successful
Build and push image / Build (push) Successful in 3m6s

This commit is contained in:
Jack 2023-08-26 03:21:53 +01:00
parent 95cca594e6
commit b30a0c664d

View File

@ -20,20 +20,23 @@ RUN case "$(dpkg --print-architecture)" in \
DEBIAN_FRONTEND="noninteractive" apt-get -qq --option Dpkg::Options::="--force-confnew" --no-install-recommends install \ DEBIAN_FRONTEND="noninteractive" apt-get -qq --option Dpkg::Options::="--force-confnew" --no-install-recommends install \
ca-certificates curl python3 fdisk $PACKAGES && \ ca-certificates curl python3 fdisk $PACKAGES && \
curl -sSfO 'https://bootstrap.pypa.io/get-pip.py' && \ curl -sSfO 'https://bootstrap.pypa.io/get-pip.py' && \
python3 get-pip.py && \ python3 get-pip.py
python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel && \
RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel && \
python3 -m pip install --no-cache-dir /tmp/motioneye && \ python3 -m pip install --no-cache-dir /tmp/motioneye && \
python3 -m pip install --no-cache-dir pytz && \ python3 -m pip install --no-cache-dir pytz && \
motioneye_init --skip-systemd --skip-apt-update && \ motioneye_init --skip-systemd --skip-apt-update
# Change uid/gid of user/group motion to match our desired IDs. This will # Change uid/gid of user/group motion to match our desired IDs. This will
# make it easier to use execute motion as our desired user later. # make it easier to use execute motion as our desired user later.
sed -i "s/^\(motion:[^:]*\):[0-9]*:[0-9]*:\(.*\)/\1:${RUN_UID}:${RUN_GID}:\2/" /etc/passwd && \ RUN sed -i "s/^\(motion:[^:]*\):[0-9]*:[0-9]*:\(.*\)/\1:${RUN_UID}:${RUN_GID}:\2/" /etc/passwd && \
sed -i "s/^\(motion:[^:]*\):[0-9]*:\(.*\)/\1:${RUN_GID}:\2/" /etc/group && \ sed -i "s/^\(motion:[^:]*\):[0-9]*:\(.*\)/\1:${RUN_GID}:\2/" /etc/group && \
mv /etc/motioneye/motioneye.conf /etc/motioneye.conf.sample && \ mv /etc/motioneye/motioneye.conf /etc/motioneye.conf.sample && \
mkdir /var/log/motioneye /var/lib/motioneye && \ mkdir /var/log/motioneye /var/lib/motioneye && \
chown motion:motion /var/log/motioneye /var/lib/motioneye && \ chown motion:motion /var/log/motioneye /var/lib/motioneye
# Cleanup # Cleanup
python3 -m pip uninstall -y pip setuptools wheel && \ RUN python3 -m pip uninstall -y pip setuptools wheel && \
DEBIAN_FRONTEND="noninteractive" apt-get -qq autopurge $PACKAGES && \ DEBIAN_FRONTEND="noninteractive" apt-get -qq autopurge $PACKAGES && \
apt-get clean && \ apt-get clean && \
rm -r /var/lib/apt/lists /var/cache/apt /tmp/motioneye get-pip.py /root/.cache rm -r /var/lib/apt/lists /var/cache/apt /tmp/motioneye get-pip.py /root/.cache