source: docker/build-msys.sh@ 976:69bc5891e14d

python3
Last change on this file since 976:69bc5891e14d was 976:69bc5891e14d, checked in by István Váradi <ivaradi@…>, 5 years ago

Reworked Windows Docker image and MSYS building (re #347)

  • Property exe set to *
File size: 1.2 KB
Line 
1#!/bin/bash
2
3set -e -u
4
5scriptdir=$(cd $(dirname $0) && pwd)
6
7VMDOMAIN=win10
8
9MSYSDIR="${scriptdir}/msys"
10
11DOCKER_IP=192.168.122.21
12DOCKER_PORT=2375
13
14DOCKER_HOST=tcp://${DOCKER_IP}:${DOCKER_PORT}
15export DOCKER_HOST
16
17set +e
18if virsh start "${VMDOMAIN}"; then
19 echo "Sleeping five minutes to wait for Windows to pull itself together..."
20 sleep 300
21else
22 echo "Could not start the Windows VM, maybe it is already up."
23fi
24
25echo "Waiting for the Docker port to be available..."
26count=0
27while ! socat /dev/null TCP4:${DOCKER_IP}:${DOCKER_PORT},connect-timeout=2; do
28 if test ${count} -gt 15; then
29 echo "Docker port is not available!"
30 exit 1
31 fi
32 count=$(expr ${count} + 1)
33 sleep 2
34done
35
36echo "Waiting for Docker to be available..."
37count=0
38while ! docker info; do
39 if test ${count} -gt 5; then
40 echo "Docker is not available!"
41 exit 1
42 fi
43 count=$(expr ${count} + 1)
44 sleep 2
45done
46
47set -e
48
49echo "Docker available, executing MSYS image build"
50docker build -t msys -f "${MSYSDIR}/Dockerfile" "${MSYSDIR}"
51
52echo "Building the MSYS distribution"
53docker run -it --rm msys c:\\msys64\\build\\build.bat
54
55echo "Shutting down the Windows VM"
56virsh shutdown --mode acpi "${VMDOMAIN}"
Note: See TracBrowser for help on using the repository browser.