copy-images 636 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. set -ex
  3. cd $(dirname $0)/..
  4. . scripts/build-common
  5. . scripts/version
  6. VERSION=${VERSION:?"VERSION not set"}
  7. BUILD=${BUILD:?"BUILD not set"}
  8. CONTAINER_INITRDBASE=$(docker create rancher/os-initrdbase:${VERSION})
  9. cleanup_initrdbase() {
  10. docker rm -v ${CONTAINER_INITRDBASE}
  11. }
  12. trap cleanup_initrdbase EXIT
  13. docker cp ${CONTAINER_INITRDBASE}:/initrd ${BUILD} # copies files to ${BUILD}/initrd
  14. CONTAINER_KERNEL=$(docker create rancher/os-kernel:${VERSION})
  15. cleanup_kernel() {
  16. docker rm -v ${CONTAINER_KERNEL}
  17. }
  18. trap cleanup_kernel EXIT
  19. docker cp ${CONTAINER_KERNEL}:/kernel ${BUILD} # copies files to ${BUILD}/kernel