package-installer 668 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. set -e
  3. cd $(dirname $0)/..
  4. source ./scripts/version
  5. DOCKERFILE=./scripts/installer/Dockerfile.${ARCH}
  6. if [ ! -f $DOCKERFILE ] || [ ! -f dist/artifacts/vmlinuz ] || [ ! -f dist/artifacts/initrd ]; then
  7. exit 0
  8. fi
  9. mkdir -p ./scripts/installer/build
  10. cp ./dist/artifacts/{initrd,vmlinuz} ./scripts/installer/build
  11. trap "rm -rf ./scripts/installer/build" EXIT
  12. docker build -t ${OS_REPO}/os:${VERSION}${SUFFIX} --build-arg VERSION=${VERSION} -f $DOCKERFILE ./scripts/installer
  13. docker save -o dist/artifacts/installer.tar ${OS_REPO}/os:${VERSION}${SUFFIX}
  14. echo ${OS_REPO}/os:${VERSION}${SUFFIX} > dist/images
  15. echo Built ${OS_REPO}/os:${VERSION}${SUFFIX}