Skip to content

Commit

Permalink
Docker: fix test for pm3 when building images
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Dec 18, 2024
1 parent f097058 commit a1a9b50
Show file tree
Hide file tree
Showing 28 changed files with 182 additions and 70 deletions.
6 changes: 4 additions & 2 deletions docker/archlinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/archlinux/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/debian-11-bullseye/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/debian-11-bullseye/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/debian-12-bookworm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/debian-12-bookworm/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/debian-13-trixie/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/debian-13-trixie/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/fedora-36/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/fedora-36/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/fedora-37/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/fedora-37/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/homebrew/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 9 additions & 3 deletions docker/homebrew/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/kali/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/kali/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/opensuse-leap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/opensuse-leap/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/opensuse-tumbleweed/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/opensuse-tumbleweed/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/parrot-core-latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/parrot-core-latest/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/ubuntu-18.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/ubuntu-18.04/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/ubuntu-20.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions docker/ubuntu-20.04/docker_build.sh
Original file line number Diff line number Diff line change
@@ -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" .
6 changes: 4 additions & 2 deletions docker/ubuntu-22.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit a1a9b50

Please sign in to comment.