diff --git a/docker/archlinux/Dockerfile b/docker/archlinux/Dockerfile index 029f7d088..900b9d04c 100644 --- a/docker/archlinux/Dockerfile +++ b/docker/archlinux/Dockerfile @@ -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 diff --git a/docker/archlinux/docker_build.sh b/docker/archlinux/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/archlinux/docker_build.sh +++ b/docker/archlinux/docker_build.sh @@ -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" . diff --git a/docker/debian-11-bullseye/Dockerfile b/docker/debian-11-bullseye/Dockerfile index dd114fa23..c32710dda 100644 --- a/docker/debian-11-bullseye/Dockerfile +++ b/docker/debian-11-bullseye/Dockerfile @@ -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 diff --git a/docker/debian-11-bullseye/docker_build.sh b/docker/debian-11-bullseye/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/debian-11-bullseye/docker_build.sh +++ b/docker/debian-11-bullseye/docker_build.sh @@ -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" . diff --git a/docker/debian-12-bookworm/Dockerfile b/docker/debian-12-bookworm/Dockerfile index 076730ea6..6c883746d 100644 --- a/docker/debian-12-bookworm/Dockerfile +++ b/docker/debian-12-bookworm/Dockerfile @@ -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 diff --git a/docker/debian-12-bookworm/docker_build.sh b/docker/debian-12-bookworm/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/debian-12-bookworm/docker_build.sh +++ b/docker/debian-12-bookworm/docker_build.sh @@ -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" . diff --git a/docker/debian-13-trixie/Dockerfile b/docker/debian-13-trixie/Dockerfile index 9cabb209f..607c5bba5 100644 --- a/docker/debian-13-trixie/Dockerfile +++ b/docker/debian-13-trixie/Dockerfile @@ -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 diff --git a/docker/debian-13-trixie/docker_build.sh b/docker/debian-13-trixie/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/debian-13-trixie/docker_build.sh +++ b/docker/debian-13-trixie/docker_build.sh @@ -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" . diff --git a/docker/fedora-36/Dockerfile b/docker/fedora-36/Dockerfile index a67964f80..1041b799a 100644 --- a/docker/fedora-36/Dockerfile +++ b/docker/fedora-36/Dockerfile @@ -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 diff --git a/docker/fedora-36/docker_build.sh b/docker/fedora-36/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/fedora-36/docker_build.sh +++ b/docker/fedora-36/docker_build.sh @@ -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" . diff --git a/docker/fedora-37/Dockerfile b/docker/fedora-37/Dockerfile index 3742290fc..bb3118fd2 100644 --- a/docker/fedora-37/Dockerfile +++ b/docker/fedora-37/Dockerfile @@ -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 diff --git a/docker/fedora-37/docker_build.sh b/docker/fedora-37/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/fedora-37/docker_build.sh +++ b/docker/fedora-37/docker_build.sh @@ -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" . diff --git a/docker/homebrew/Dockerfile b/docker/homebrew/Dockerfile index e44687075..d4893d154 100644 --- a/docker/homebrew/Dockerfile +++ b/docker/homebrew/Dockerfile @@ -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" diff --git a/docker/homebrew/docker_build.sh b/docker/homebrew/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/homebrew/docker_build.sh +++ b/docker/homebrew/docker_build.sh @@ -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" . diff --git a/docker/kali/Dockerfile b/docker/kali/Dockerfile index 1bd2c2fb6..90349c69d 100644 --- a/docker/kali/Dockerfile +++ b/docker/kali/Dockerfile @@ -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 diff --git a/docker/kali/docker_build.sh b/docker/kali/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/kali/docker_build.sh +++ b/docker/kali/docker_build.sh @@ -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" . diff --git a/docker/opensuse-leap/Dockerfile b/docker/opensuse-leap/Dockerfile index fb452be09..f381bfd9e 100644 --- a/docker/opensuse-leap/Dockerfile +++ b/docker/opensuse-leap/Dockerfile @@ -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 diff --git a/docker/opensuse-leap/docker_build.sh b/docker/opensuse-leap/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/opensuse-leap/docker_build.sh +++ b/docker/opensuse-leap/docker_build.sh @@ -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" . diff --git a/docker/opensuse-tumbleweed/Dockerfile b/docker/opensuse-tumbleweed/Dockerfile index 37ebb44fb..a0faf50c2 100644 --- a/docker/opensuse-tumbleweed/Dockerfile +++ b/docker/opensuse-tumbleweed/Dockerfile @@ -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 diff --git a/docker/opensuse-tumbleweed/docker_build.sh b/docker/opensuse-tumbleweed/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/opensuse-tumbleweed/docker_build.sh +++ b/docker/opensuse-tumbleweed/docker_build.sh @@ -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" . diff --git a/docker/parrot-core-latest/Dockerfile b/docker/parrot-core-latest/Dockerfile index 8db8d8fee..044acdff4 100644 --- a/docker/parrot-core-latest/Dockerfile +++ b/docker/parrot-core-latest/Dockerfile @@ -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 diff --git a/docker/parrot-core-latest/docker_build.sh b/docker/parrot-core-latest/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/parrot-core-latest/docker_build.sh +++ b/docker/parrot-core-latest/docker_build.sh @@ -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" . diff --git a/docker/ubuntu-18.04/Dockerfile b/docker/ubuntu-18.04/Dockerfile index 166c9beca..f287c344e 100644 --- a/docker/ubuntu-18.04/Dockerfile +++ b/docker/ubuntu-18.04/Dockerfile @@ -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 diff --git a/docker/ubuntu-18.04/docker_build.sh b/docker/ubuntu-18.04/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/ubuntu-18.04/docker_build.sh +++ b/docker/ubuntu-18.04/docker_build.sh @@ -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" . diff --git a/docker/ubuntu-20.04/Dockerfile b/docker/ubuntu-20.04/Dockerfile index a33caf3f8..c02544234 100644 --- a/docker/ubuntu-20.04/Dockerfile +++ b/docker/ubuntu-20.04/Dockerfile @@ -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 diff --git a/docker/ubuntu-20.04/docker_build.sh b/docker/ubuntu-20.04/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/ubuntu-20.04/docker_build.sh +++ b/docker/ubuntu-20.04/docker_build.sh @@ -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" . diff --git a/docker/ubuntu-22.04/Dockerfile b/docker/ubuntu-22.04/Dockerfile index 55ec91514..d182d893e 100644 --- a/docker/ubuntu-22.04/Dockerfile +++ b/docker/ubuntu-22.04/Dockerfile @@ -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 diff --git a/docker/ubuntu-22.04/docker_build.sh b/docker/ubuntu-22.04/docker_build.sh index d662c5874..d0c94091e 100755 --- a/docker/ubuntu-22.04/docker_build.sh +++ b/docker/ubuntu-22.04/docker_build.sh @@ -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" .