Docker: fix test for pm3 when building images

This commit is contained in:
Philippe Teuwen 2024-12-18 15:29:26 +01:00
commit a1a9b50d24
28 changed files with 182 additions and 70 deletions

View file

@ -17,8 +17,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -22,8 +22,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -20,8 +20,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -20,8 +20,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -15,8 +15,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -15,8 +15,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -4,8 +4,10 @@ ENV LANG=C
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN sudo groupadd -g ${UART_GID} mydialout || true
RUN sudo usermod -aG ${UART_GID} linuxbrew
RUN if [ -n "${UART_GID}" ]; then \
sudo groupadd -g ${UART_GID} mydialout || true; \
sudo usermod -aG ${UART_GID} linuxbrew; \
fi
USER linuxbrew
WORKDIR "/home/linuxbrew"

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -20,8 +20,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -18,8 +18,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) NOPASSWD: ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -17,8 +17,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) NOPASSWD: ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -20,8 +20,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -23,8 +23,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -22,8 +22,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -22,8 +22,10 @@ RUN useradd -ms /bin/bash rrg
RUN passwd -d rrg
ARG UART_GID
# dialout group may already exist on another numeric ID than on host
RUN groupadd -g ${UART_GID} mydialout || true
RUN usermod -aG ${UART_GID} rrg
RUN if [ -n "${UART_GID}" ]; then \
groupadd -g ${UART_GID} mydialout || true; \
usermod -aG ${UART_GID} rrg; \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
USER rrg

View file

@ -1,6 +1,12 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|head -n1|cut -d' ' -f2)"
UART_GID="$(stat -c '%g' $UART_PORT)"
docker build --build-arg UART_GID="$UART_GID" -t "$DOCKER_IMAGE" .
# Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
UART_GID="$(stat -c '%g' $UART_PORT)"
BUILDARG="--build-arg UART_GID=$UART_GID"
else
BUILDARG=""
fi
docker build $BUILDARG -t "$DOCKER_IMAGE" .