1
0
mirror of https://github.com/rancher/os.git synced 2025-07-30 22:24:33 +00:00
os/scripts/package-installer
Sven Dowideit 47eaf2bda4 can't work yet - need the host fs to have the iso mounted...
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-15 23:40:18 +00:00

40 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
set -e
cd $(dirname $0)/..
source ./scripts/version
BASEDOCKERFILE=./scripts/installer/BaseDockerfile.${ARCH}
DOCKERFILE=./scripts/installer/Dockerfile.${ARCH}
if [ ! -f $DOCKERFILE ] || [ ! -f dist/artifacts/vmlinuz-${KERNEL_VERSION} ] || [ ! -f dist/artifacts/initrd ]; then
exit 0
fi
mkdir -p ./scripts/installer/build
cp ./dist/artifacts/initrd ./scripts/installer/build
cp ./dist/artifacts/vmlinuz-${KERNEL_VERSION} ./scripts/installer/build
cp ./bin/ros ./scripts/installer/build
trap "rm -rf ./scripts/installer/build" EXIT
# installer base image - can be included in iso
# TODO: fix the fullinstaller Dockerfile to use the ${VERSION}${SUFFIX}
docker build \
-t ${OS_REPO}/os-installer \
-f $BASEDOCKERFILE \
./scripts/installer
docker save -o dist/artifacts/installer.tar ${OS_REPO}/os-installer
# Full installer image with initrd - used for pulling from network
docker build \
-t ${OS_REPO}/os:${VERSION}${SUFFIX} \
--build-arg VERSION=${VERSION} \
--build-arg KERNEL_VERSION=${KERNEL_VERSION} \
-f $DOCKERFILE \
./scripts/installer
docker save -o dist/artifacts/fullinstaller.tar ${OS_REPO}/os:${VERSION}${SUFFIX}
echo ${OS_REPO}/os:${VERSION}${SUFFIX} >> dist/images
echo Built ${OS_REPO}/os:${VERSION}${SUFFIX}