forked from rancher/rancher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-windows.dapper
90 lines (83 loc) · 3.55 KB
/
Dockerfile-windows.dapper
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
FROM golang:1.12-windowsservercore
SHELL ["powershell", "-NoLogo", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ARG DAPPER_HOST_ARCH
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
RUN pushd c:\; \
$URL = 'https://github.com/dscharrer/innoextract/releases/download/1.7/innoextract-1.7-windows.zip'; \
\
Write-Host ('Downloading innoextract from {0} ...' -f $URL); \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest -UseBasicParsing -OutFile c:\innoextract.zip -Uri $URL; \
\
Write-Host 'Expanding ...'; \
Expand-Archive -Path c:\innoextract.zip -DestinationPath c:\innoextract\.; \
\
Write-Host 'Cleaning ...'; \
Remove-Item -Force -Recurse -Path c:\innoextract.zip; \
\
Write-Host 'Updating PATH ...'; \
[Environment]::SetEnvironmentVariable('PATH', ('c:\innoextract\;{0}' -f $env:PATH), [EnvironmentVariableTarget]::Machine); \
\
Write-Host 'Complete.'; \
popd;
RUN pushd c:\; \
$URL = 'https://github.com/docker/toolbox/releases/download/v18.09.3/DockerToolbox-18.09.3.exe'; \
\
Write-Host ('Downloading docker from {0} ...' -f $URL); \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest -UseBasicParsing -OutFile c:\dockertoolbox.exe -Uri $URL; \
\
Write-Host 'Expanding ...'; \
innoextract c:\dockertoolbox.exe; \
\
Write-Host 'Cleaning ...'; \
Remove-Item -Force -Recurse -Path @('c:\dockertoolbox.exe', 'c:\app\*') -Exclude @('docker.exe'); \
\
Write-Host 'Updating PATH ...'; \
[Environment]::SetEnvironmentVariable('PATH', ('c:\app\;{0}' -f $env:PATH), [EnvironmentVariableTarget]::Machine); \
\
Write-Host 'Complete.'; \
popd;
RUN pushd c:\; \
$URL = 'https://github.com/golangci/golangci-lint/releases/download/v1.16.0/golangci-lint-1.16.0-windows-amd64.zip'; \
\
Write-Host ('Downloading golangci from {0} ...' -f $URL); \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest -UseBasicParsing -OutFile c:\golangci-lint.zip -Uri $URL; \
\
Write-Host 'Expanding ...'; \
Expand-Archive -Path c:\golangci-lint.zip -DestinationPath c:\; \
\
Write-Host 'Cleaning ...'; \
Remove-Item -Force -Recurse -Path c:\golangci-lint.zip; \
\
Write-Host 'Updating PATH ...'; \
[Environment]::SetEnvironmentVariable('PATH', ('c:\golangci-lint-1.16.0-windows-amd64\;{0}' -f $env:PATH), [EnvironmentVariableTarget]::Machine); \
\
Write-Host 'Complete.'; \
popd;
# upgrade git
RUN pushd c:\; \
$URL = 'https://github.com/git-for-windows/git/releases/download/v2.21.0.windows.1/MinGit-2.21.0-64-bit.zip'; \
\
Write-Host ('Downloading git from {0} ...' -f $URL); \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest -UseBasicParsing -OutFile c:\git.zip -Uri $URL; \
\
Write-Host 'Expanding ...'; \
Expand-Archive -Force -Path c:\git.zip -DestinationPath c:\git\.; \
\
Write-Host 'Cleaning ...'; \
Remove-Item -Force -Recurse -Path c:\git.zip; \
\
Write-Host 'Complete.'; \
popd;
ENV DAPPER_ENV REPO TAG DRONE_TAG
ENV DAPPER_SOURCE /gopath/src/github.com/rancher/rancher
ENV DAPPER_OUTPUT ./bin
ENV DAPPER_DOCKER_SOCKET true
ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache
ENV HOME ${DAPPER_SOURCE}
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["powershell", "-NoLogo", "-NonInteractive", "-File", "./scripts/windows/entry.ps1"]
CMD ["ci"]