From 3b161ecf2fa8a27a6d55ad011fd881946858ee57 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Mon, 16 Oct 2023 10:38:27 +0200 Subject: [PATCH] Layer reduziert. User vars angepasst. LineBreak umgestellt --- ...erfile.bullseye.test_install_unified.armv7 | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/ci/Dockerfile.bullseye.test_install_unified.armv7 b/ci/Dockerfile.bullseye.test_install_unified.armv7 index fe4713e0d..941ae1d2c 100644 --- a/ci/Dockerfile.bullseye.test_install_unified.armv7 +++ b/ci/Dockerfile.bullseye.test_install_unified.armv7 @@ -6,29 +6,29 @@ ENV DEBIAN_FRONTEND=noninteractive RUN touch /boot/cmdlinetxt # Install packages -RUN apt-get update && \ - apt-get -y install \ +RUN apt-get update \ + && apt-get -y install \ apt-utils \ curl \ - gnupg - -RUN echo 'deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi' > /etc/apt/sources.list.d/raspi.list ;\ - echo 'deb http://archive.raspberrypi.org/debian/ bullseye main' >> /etc/apt/sources.list.d/raspi.list ;\ - curl http://raspbian.raspberrypi.org/raspbian.public.key | apt-key add - ;\ - curl http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | apt-key add - ;\ - apt-get update && \ - apt-get -y install \ + gnupg \ + && echo 'deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi' > /etc/apt/sources.list.d/raspi.list \ + && echo 'deb http://archive.raspberrypi.org/debian/ bullseye main' >> /etc/apt/sources.list.d/raspi.list \ + && curl http://raspbian.raspberrypi.org/raspbian.public.key | apt-key add - \ + && curl http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | apt-key add - \ + && apt-get update \ + && apt-get -y upgrade \ + && apt-get -y install \ build-essential \ git \ iw \ locales \ - # install here to speed up GitHub Action - raspberrypi-kernel-headers \ sudo \ systemd \ wget \ - wpasupplicant ;\ - rm -rf /var/lib/apt/lists/* + wpasupplicant \ + # install internally used packages here to speed up GitHub Action + raspberrypi-kernel-headers \ + && rm -rf /var/lib/apt/lists/* FROM base as user @@ -36,17 +36,17 @@ ENV TEST_USER_GROUP=test RUN groupadd --gid 1002 $TEST_USER_GROUP -RUN export USER=pi &&\ - export USER_GROUP=$USER &&\ - groupadd --gid 1000 $USER_GROUP &&\ - useradd -u 1000 -g $USER_GROUP -G sudo,$TEST_USER_GROUP -d /home/$USER -m -s /bin/bash -p '$1$iV7TOwOe$6ojkJQXyEA9bHd/SqNLNj0' $USER &&\ - echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER +RUN export USER_PI=pi \ + && export USER_PI_GROUP=$USER_PI \ + && groupadd --gid 1000 $USER_PI_GROUP \ + && useradd -u 1000 -g $USER_PI_GROUP -G sudo,$TEST_USER_GROUP -d /home/$USER_PI -m -s /bin/bash -p '$1$iV7TOwOe$6ojkJQXyEA9bHd/SqNLNj0' $USER_PI \ + && echo "$USER_PI ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER_PI -RUN export USER=hans &&\ - export USER_GROUP=wurst &&\ - groupadd --gid 1001 $USER_GROUP &&\ - useradd -u 1001 -g $USER_GROUP -G sudo,$TEST_USER_GROUP -d /home/$USER -m -s /bin/bash -p '$1$iV7TOwOe$6ojkJQXyEA9bHd/SqNLNj0' $USER &&\ - echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER +RUN export USER_ALT=hans \ + && export USER_ALT_GROUP=wurst \ + && groupadd --gid 1001 $USER_ALT_GROUP \ + && useradd -u 1001 -g $USER_ALT_GROUP -G sudo,$TEST_USER_GROUP -d /home/$USER_ALT -m -s /bin/bash -p '$1$iV7TOwOe$6ojkJQXyEA9bHd/SqNLNj0' $USER_ALT \ + && echo "$USER_ALT ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER_ALT FROM user as test @@ -57,11 +57,10 @@ ARG GIT_URL ENV GIT_BRANCH=$GIT_BRANCH GIT_URL=$GIT_URL # Define needed files for installation tests -COPY --chown=root:$TEST_USER_GROUP --chmod=770 scripts/installscripts/tests/*.sh /tests/ COPY --chown=root:$TEST_USER_GROUP --chmod=770 scripts/installscripts/buster-install-default.sh / - WORKDIR /tests +COPY --chown=root:$TEST_USER_GROUP --chmod=770 scripts/installscripts/tests/*.sh / FROM test as test-update -RUN sudo apt-get update && sudo apt-get -y upgrade +RUN apt-get update && apt-get -y upgrade