-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.windows
109 lines (86 loc) · 4.02 KB
/
Dockerfile.windows
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
FROM debian:bookworm-slim
ENV DEBIAN_FRONTEND noninteractive
ARG DOCKER_RELEASE_STAGE
ARG INSTALLER_VERSION
ARG DOCKER_VERSION
ARG DOCKER_BUILDX_VERSION
ARG DOCKER_COMPOSE2_VERSION
ARG DOCKER_MACHINE_VERSION
ARG GITLAB_MACHINE_VERSION
ARG T2D_MACHINE_VERSION
ARG GIT_VERSION
ARG GIT_REVISION
ARG VBOX_VERSION_WIN
ARG VBOX_REV_WIN
ARG MIXPANEL_TOKEN
RUN dpkg --add-architecture i386
RUN sed -i "s/main/main contrib non-free/" /etc/apt/sources.list.d/debian.sources
RUN apt-get update && apt-get install -yq wine curl unrar unzip
# innosetup
RUN mkdir /innosetup && \
cd /innosetup && \
curl -fsSL -o innounp045.rar "https://downloads.sourceforge.net/project/innounp/innounp/innounp%200.45/innounp045.rar?r=&ts=1439566551&use_mirror=skylineservers" && \
unrar e innounp045.rar
RUN cd /innosetup && \
curl -fsSL -o is-unicode.exe http://files.jrsoftware.org/is/5/isetup-5.5.8-unicode.exe && \
wine "./innounp.exe" -e "is-unicode.exe"
# Download CLI binary
# Docker cli github repo now builds binarys for multiple windows targets.
# ie. amd64 / arm64 etc. Downloading a precompiled binary is now easier
# than compiling from source.
RUN curl -fsSL -o dockerbins.zip "https://download.docker.com/win/static/${DOCKER_RELEASE_STAGE}/x86_64/docker-${DOCKER_VERSION}.zip" && \
unzip dockerbins.zip && \
rm dockerbins.zip
# Assemble bundle
RUN mkdir -p /bundle/plugin
WORKDIR /bundle
RUN cp /docker/docker.exe .
# Docker Machine
ENV DOCKER_MACHINE_URL "https://github.com/kaosagnt/docker-machine/releases/download/v$DOCKER_MACHINE_VERSION-$GITLAB_MACHINE_VERSION-$T2D_MACHINE_VERSION"
ENV DOCKER_MACHINE_FILE "docker-machine-Windows-x86_64.exe"
RUN curl -fsSL -o docker-machine.exe \
"$DOCKER_MACHINE_URL/$DOCKER_MACHINE_FILE" \
&& echo "$(curl -fsSL "$DOCKER_MACHINE_URL"'/SHA256SUMS.txt' \
| awk '$2 ~ /Windows-x86_64.exe$/ { print $1 }') *docker-machine.exe" \
| sha256sum -c -
# Docker compose 2.x
ENV DOCKER_COMPOSE2_URL "https://github.com/docker/compose/releases/download/v$DOCKER_COMPOSE2_VERSION"
ENV DOCKER_COMPOSE2_FILE "docker-compose-windows-x86_64.exe"
RUN curl -fsSL -o plugin/docker-compose.exe \
"$DOCKER_COMPOSE2_URL/$DOCKER_COMPOSE2_FILE" \
&& echo "$(curl -fsSL "$DOCKER_COMPOSE2_URL"'/checksums.txt' \
| awk '$2 ~ /windows-x86_64.exe$/ { print $1 }') *plugin/docker-compose.exe" \
| sha256sum -c -
# Docker Buildx plugin
ENV DOCKER_BUILDX_URL "https://github.com/docker/buildx/releases/download/v$DOCKER_BUILDX_VERSION"
ENV DOCKER_BUILDX_FILE "buildx-v${DOCKER_BUILDX_VERSION}.windows-amd64.exe"
RUN curl -fsSL -o plugin/docker-buildx.exe \
"$DOCKER_BUILDX_URL/$DOCKER_BUILDX_FILE" \
&& echo "$(curl -fsSL "$DOCKER_BUILDX_URL"'/checksums.txt' \
| awk '$2 ~ /windows-amd64.exe$/ { print $1 }') *plugin/docker-buildx.exe" \
| sha256sum -c -
# boot2docker iso
ENV BOOT2DOCKER_URL "https://github.com/kaosagnt/boot2docker-xfs-ng/releases/download/$DOCKER_VERSION"
ENV BOOT2DOCKER_FILE "boot2docker.iso"
RUN curl -fsSL -o boot2docker.iso \
"$BOOT2DOCKER_URL/$BOOT2DOCKER_FILE" \
&& echo "$(curl -fsSL "$BOOT2DOCKER_URL"'/SHA256SUMS.txt' \
| awk '$2 ~ /iso$/ { print $1 }') *boot2docker.iso" \
| sha256sum -c -
# Git
RUN if [ $GIT_REVISION -gt 1 ]; then GIT_FILENAME="Git-$GIT_VERSION.$GIT_REVISION-64-bit.exe"; else GIT_FILENAME="Git-$GIT_VERSION-64-bit.exe"; fi; \
curl -fsSL -o Git.exe "https://github.com/git-for-windows/git/releases/download/v$GIT_VERSION.windows.$GIT_REVISION/$GIT_FILENAME"
ENV VBOX_URL "https://download.virtualbox.org/virtualbox/$VBOX_VERSION_WIN"
ENV VBOX_EXE "$VBOX_URL/VirtualBox-$VBOX_VERSION_WIN-$VBOX_REV_WIN-Win.exe"
RUN curl -fsSL -o virtualbox.exe "$VBOX_EXE" \
&& echo "$(curl -fsSL "$VBOX_URL"'/SHA256SUMS' \
| awk '$2 ~ /-Win.exe$/ { print $1 }') *virtualbox.exe" \
| sha256sum -c -
RUN wine virtualbox.exe -extract -silent -path . && \
rm virtualbox.exe && \
mv *.msi VirtualBox_amd64.msi
# Add installer resources
COPY windows /installer
WORKDIR /installer
RUN rm -rf /tmp/.wine-0/
RUN wine ../innosetup/ISCC.exe Toolbox.iss /DMyAppVersion=$INSTALLER_VERSION /DMixpanelToken=$MIXPANEL_TOKEN