1
0
mirror of https://github.com/rancher/os.git synced 2025-05-01 04:44:06 +00:00
os/scripts/build-images
2018-11-22 16:28:50 +08:00

33 lines
677 B
Bash
Executable File

#!/bin/bash
set -ex
export ARCH=${ARCH:-"amd64"}
BASE=images
source $(dirname $0)/version
cd $(dirname $0)/..
mkdir -p dist
rm -f dist/images
touch dist/images
for i in $BASE/[0-9]*; do
name="os-$(echo ${i} | cut -f2 -d-)"
tag="${OS_REPO}/${name}:${VERSION}${SUFFIX}"
echo "build-image: Building ${tag}"
if [ -x ${i}/prebuild.sh ]; then
${i}/prebuild.sh
fi
if dapper -d --build -f ${i}/Dockerfile -- -t rancher/${name} ${i}; then
docker tag rancher/${name} ${tag}
echo "${tag}" >> dist/images
elif [ "$?" != "42" ]; then
exit 1
else
echo "WARN: Skipping ${tag}"
fi
done
echo "build-image: DONE"