29 lines
589 B
Bash
29 lines
589 B
Bash
|
#!/bin/bash
|
||
|
usage(){
|
||
|
echo -e "Usage:\n\t$0 [arm|arm64|x86]"
|
||
|
exit 1
|
||
|
}
|
||
|
if [[ -z "$1" ]]; then
|
||
|
usage
|
||
|
fi
|
||
|
ARCH=${1,,}
|
||
|
[[ -d ./images ]] || mkdir ./images
|
||
|
case $ARCH in
|
||
|
arm)
|
||
|
sudo docker buildx build --no-cache --platform linux/arm/v6 -t mdns .
|
||
|
sudo docker save mdns -o ./images/mdns_arm32.tar
|
||
|
;;
|
||
|
arm64)
|
||
|
sudo docker buildx build --no-cache --platform linux/arm64 -t mdns .
|
||
|
sudo docker save mdns -o ./images/mdns_arm64.tar
|
||
|
;;
|
||
|
x86)
|
||
|
sudo docker buildx build --no-cache --platform linux/amd64 -t mdns .
|
||
|
sudo docker save mdns -o ./images/mdns_x86.tar
|
||
|
;;
|
||
|
*)
|
||
|
usage
|
||
|
;;
|
||
|
esac
|
||
|
|