Merge pull request #2695 from ry4000/master
[RRG-proxmark3.git] / docker / build.sh
blob4991009422fed0ea21c607d0341cd6c0c5ff8621
1 #!/bin/bash
3 if [ ! -e docker_conf.inc ]; then
4 echo "This script must be run from within one of the subfolders"
5 exit 1
6 fi
7 . docker_conf.inc
8 # Make sure to connect a Proxmark3 when building if you want to be able to access it from within the Docker instance
9 UART_PORT="$(../../pm3 --list|grep /dev|head -n1|cut -d' ' -f2)"
10 if [ -n "$UART_PORT" ]; then
11 UART_GID="$(stat -c '%g' $UART_PORT)"
12 BUILDARG="--build-arg UART_GID=$UART_GID"
13 else
14 BUILDARG=""
17 # For cross-platform support:
18 # cf https://github.com/multiarch/qemu-user-static
19 #sudo apt install qemu-user-static
20 # credential=yes needed to get proper sudo support in cross-platform Docker instances
21 #docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
22 #docker buildx create --use
23 #docker buildx inspect --bootstrap
24 #docker buildx build $DOCKER_PLATFORM $BUILDARG -t "$DOCKER_IMAGE" --load .
25 # Seems to work without buildx:
26 docker build $DOCKER_PLATFORM $BUILDARG -t "$DOCKER_IMAGE" .