build-images 669 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. set -e
  3. export ARCH=${ARCH:-"amd64"}
  4. BASE=images
  5. source $(dirname $0)/version
  6. cd $(dirname $0)/..
  7. mkdir -p dist
  8. rm -f dist/images
  9. touch dist/images
  10. for i in $BASE/[0-9]*; do
  11. name="os-$(echo ${i} | cut -f2 -d-)"
  12. tag="${OS_REPO}/${name}:${VERSION}${SUFFIX}"
  13. echo "build-image: Building ${tag}"
  14. if [ -x ${i}/prebuild.sh ]; then
  15. ${i}/prebuild.sh
  16. fi
  17. if dapper -d --build -f ${i}/Dockerfile -- -t rancher/${name} ${i}; then
  18. docker tag rancher/${name} ${tag}
  19. echo "${tag}" >> dist/images
  20. elif [ "$?" != "42" ]; then
  21. exit 1
  22. else
  23. echo "WARN: Skipping ${tag}"
  24. fi
  25. done
  26. echo "build-image: DONE"