Skip to content

Commit

Permalink
Layer reduziert.
Browse files Browse the repository at this point in the history
User vars angepasst.
LineBreak umgestellt
  • Loading branch information
AlvinSchiller committed Oct 16, 2023
1 parent e944675 commit 3b161ec
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions ci/Dockerfile.bullseye.test_install_unified.armv7
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,47 @@ 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
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
Expand All @@ -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

0 comments on commit 3b161ec

Please sign in to comment.