Skip to content

Commit

Permalink
Update build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
FanZhang526 authored Oct 10, 2024
1 parent c0a35bb commit 4e9be88
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ make -f Makefile VER=$1 PLATFORM=$2
echo "Platform confirmation"
if [[ "${PLATFORM}" == "ARM" ]];then
PULL_FLAG="--platform=arm64"
BUILD_FLAG="--platform linux/arm64"
elif [[ "${PLATFORM}" == "X86" ]];then
PULL_FLAG="--platform=amd64"
BUILD_FLAG="--platform linux/amd64"
else
echo "Wrong PLATFORM, support [X86, ARM]"
exit
Expand All @@ -63,9 +65,9 @@ function build_image() {
for img in ${images[@]}; do
echo "build the ${img} image"
chmod +x "${img}"
docker build -f Dockerfile -t "${img}":"${VER}" --target "${img}" --build-arg VER="${VER}" .
docker save "${img}":"${VER}" -o "${img}"-"${VER}".tar
mv "${img}"-"${VER}".tar "${release_dir_path}/image"
docker build ${BUILD_FLAG} -f Dockerfile -t ${img}:${VER} --target ${img} --build-arg VER=${VER} .
docker save ${img}:${VER} -o ${img}-${VER}.tar
mv ${img}-${VER}.tar ${release_dir_path}/image
done
}
build_image
Expand Down

0 comments on commit 4e9be88

Please sign in to comment.