You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
832 B
Bash
45 lines
832 B
Bash
#!/bin/bash
|
|
|
|
display_usage() {
|
|
echo "Usage: $0 reactor_type"
|
|
}
|
|
|
|
# checking for help options
|
|
if [[ $@ == "--help" || $@ == "-h" ]]
|
|
then
|
|
display_usage
|
|
exit 0
|
|
fi
|
|
|
|
# checking that arguements are not empty
|
|
if [[ -z $1 ]]
|
|
then
|
|
echo "Type of reactor not specified!"
|
|
display_usage
|
|
exit 1
|
|
fi
|
|
|
|
# checking for valid reactor types
|
|
if [[ $1 == "pi" ]]
|
|
then
|
|
platform="linux/arm64"
|
|
elif [[ $1 == "bb" ]]
|
|
then
|
|
platform="linux/arm/v7"
|
|
else
|
|
echo "Reactor type $1 not supported!"
|
|
echo "Supported reactors include: pi, bb"
|
|
display_usage
|
|
exit 1
|
|
fi
|
|
|
|
# building reactor image
|
|
|
|
echo "Building Reactor image for $1 platform=$platform"
|
|
|
|
docker buildx build --rm --platform=$platform -f Dockerfile.reactor --tag localhost:5000/reactor .
|
|
|
|
echo "Cleaning local images"
|
|
|
|
docker image remove localhost:5000/reactor
|