docker-windows/prepare_image.sh

36 lines
1,015 B
Bash
Raw Normal View History

2025-03-31 07:16:25 +00:00
#!/usr/bin/env bash
2025-04-01 11:11:22 +03:00
set -Eeuo pipefail
2025-03-31 07:16:25 +00:00
source env.sh
echo "start to build and install windows"
2025-04-08 11:50:56 +00:00
docker compose up windows-build -d --build --force-recreate
2025-04-01 11:11:22 +03:00
echo "streaming logs..."
docker logs -f windows-build | tee windows-build.log &
echo "waiting for windows-build container to be healthy..."
while [[ "$(docker inspect --format='{{.State.Health.Status}}' windows-build 2>/dev/null)" != "healthy" ]]; do
sleep 2
done
2025-03-31 07:16:25 +00:00
echo "windows installed, now stop container"
docker stop windows-build
echo "commit all the changes"
docker commit windows-build "$IMAGE_NAME:$IMAGE_VERSION"
docker images
echo "start container with windows installed"
2025-04-01 11:11:22 +03:00
docker compose up windows-installed -d
echo "streaming logs..."
docker logs -f windows-installed | tee windows-installed.log &
echo "waiting for windows-installed container to be healthy..."
while [[ "$(docker inspect --format='{{.State.Health.Status}}' windows-installed 2>/dev/null)" != "healthy" ]]; do
sleep 2
done
docker push "$IMAGE_NAME:$IMAGE_VERSION"