Refactor Docker scripts

This commit is contained in:
Philippe Teuwen 2024-12-18 22:18:05 +01:00
parent 8e99b792b2
commit 12775960dc
69 changed files with 26 additions and 457 deletions

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-arch:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -1,5 +1,5 @@
#!/bin/bash
for os in archlinux debian-12-bookworm debian-12-bookworm-arm64 debian-12-bookworm-armhf debian-13-trixie fedora-36 fedora-37 homebrew kali opensuse-leap opensuse-tumbleweed parrot-core-latest ubuntu-20.04 ubuntu-22.04; do
( cd $os && ./docker_build.sh )
( cd $os && ../build.sh )
done

View file

@ -1,6 +1,10 @@
#!/bin/bash
. docker_conf
if [ ! -e docker_conf.inc ]; then
echo "This script must be run from within one of the subfolders"
exit 1
fi
. docker_conf.inc
# 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
@ -10,10 +14,12 @@ else
BUILDARG=""
fi
# For cross-platform support:
# cf https://github.com/multiarch/qemu-user-static
#sudo apt install qemu-user-static
#docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
#docker buildx create --use
#docker buildx inspect --bootstrap
#docker buildx build $DOCKER_PLATFORM $BUILDARG -t "$DOCKER_IMAGE" --load .
# Seems to work without buildx:
docker build $DOCKER_PLATFORM $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-debian-bullseye:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -19,7 +19,7 @@ RUN if [ -n "${UART_GID}" ]; then \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
#USER rrg
USER rrg
WORKDIR "/home/rrg"
CMD ["/bin/bash"]

View file

@ -1,3 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-debian-bookworm-arm64:1.0
DOCKER_PLATFORM="--platform linux/arm64"

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -19,7 +19,7 @@ RUN if [ -n "${UART_GID}" ]; then \
fi
RUN printf 'rrg ALL=(ALL) ALL\n' | tee -a /etc/sudoers
#USER rrg
USER rrg
WORKDIR "/home/rrg"
CMD ["/bin/bash"]

View file

@ -1,19 +0,0 @@
#!/bin/bash
. docker_conf
# 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
# cf https://github.com/multiarch/qemu-user-static
#sudo apt install qemu-user-static
#docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
#docker buildx create --use
#docker buildx inspect --bootstrap
#docker buildx build $DOCKER_PLATFORM $BUILDARG -t "$DOCKER_IMAGE" --load .
docker build $DOCKER_PLATFORM $BUILDARG -t "$DOCKER_IMAGE" .

View file

@ -1,3 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-debian-bookworm-armhf:1.0
DOCKER_PLATFORM="--platform linux/arm/v7"

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV $DOCKER_PLATFORM --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-debian-bookworm:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-debian-trixie:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-fedora-36:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-fedora-37:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -1,5 +1,7 @@
# Notes on linux homebrew
If needed to install sth, run brew as user linuxbrew
Do not `brew install arm-none-eabi-gcc`, it's a Mach-O executable.
So only host bins can be built (except tools/hitag2crack/crack5opencl which needs OpenCL)

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-brew:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,11 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"
# if needed, run brew as user linuxbrew

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-kali:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-suse-leap:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-suse-tumbleweed:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-parrotsec-core-latest:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

9
docker/rm.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
if [ ! -e docker_conf.inc ]; then
echo "This script must be run from within one of the subfolders"
exit 1
fi
. docker_conf.inc
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,6 +1,10 @@
#!/bin/bash
. docker_conf
if [ ! -e docker_conf.inc ]; then
echo "This script must be run from within one of the subfolders"
exit 1
fi
. docker_conf.inc
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-ubuntu-18.04:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-ubuntu-20.04:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"

View file

@ -1,12 +0,0 @@
#!/bin/bash
. docker_conf
# 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

@ -1,2 +0,0 @@
# sourceme
DOCKER_IMAGE=pm3-ubuntu-22.04:1.0

View file

@ -1,5 +0,0 @@
#!/bin/bash
. docker_conf
docker rm $(docker ps -aq --filter ancestor="$DOCKER_IMAGE")
docker image rm "$DOCKER_IMAGE"

View file

@ -1,10 +0,0 @@
#!/bin/bash
. docker_conf
UART_PORT="$(../../pm3 --list|grep dev|head -n1|cut -d' ' -f2)"
if [ -n "$UART_PORT" ]; then
DEV="--device=/dev/tty0 --device=$UART_PORT"
else
DEV=""
fi
docker run $DEV --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 -it "$DOCKER_IMAGE"