mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-01 12:32:12 +00:00
adjust build script for docker engine
builder setup is no longer needed amd64 and arm64 support
This commit is contained in:
parent
65a443d778
commit
81aad58c2f
1 changed files with 22 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Buildx Example: docker buildx build --platform linux/amd64,linux/arm64 -t username/demo:latest --push .
|
||||||
|
|
||||||
# Setup Vars
|
# Setup Vars
|
||||||
myPLATFORMS="linux/amd64,linux/arm64"
|
myPLATFORMS="linux/amd64,linux/arm64"
|
||||||
myHUBORG="dtagdevsec"
|
myHUBORG="dtagdevsec"
|
||||||
|
@ -23,9 +25,28 @@ fi
|
||||||
docker buildx > /dev/null 2>&1
|
docker buildx > /dev/null 2>&1
|
||||||
if [ "$?" == "1" ];
|
if [ "$?" == "1" ];
|
||||||
then
|
then
|
||||||
echo "### Build environment not setup. Run bin/setup_builder.sh"
|
echo "### Build environment not setup. Install docker engine from docker:"
|
||||||
|
echo "### https://docs.docker.com/engine/install/debian/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Let's ensure arm64 and amd64 are supported
|
||||||
|
echo "### Let's ensure ARM64 and AMD64 are supported ..."
|
||||||
|
myARCHITECTURES="amd64 arm64"
|
||||||
|
mySUPPORTED=$(docker buildx inspect --bootstrap)
|
||||||
|
|
||||||
|
for i in $myARCHITECTURES;
|
||||||
|
do
|
||||||
|
if ! echo $mySUPPORTED | grep -q linux/$i;
|
||||||
|
then
|
||||||
|
echo "## Installing $i support ..."
|
||||||
|
docker run --privileged --rm tonistiigi/binfmt --install $i
|
||||||
|
docker buildx inspect --bootstrap
|
||||||
|
else
|
||||||
|
echo "## $i support detected!"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
|
||||||
# Only run with command switch
|
# Only run with command switch
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
echo "### T-Pot Multi Arch Image Builder."
|
echo "### T-Pot Multi Arch Image Builder."
|
||||||
|
|
Loading…
Reference in a new issue