forked from buildkite/agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-windows
30 lines (22 loc) · 1.18 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
## Development docker image for buildkite-agent on windows
FROM microsoft/windowsservercore:latest
ENV ChocolateyUseWindowsCompression false
# Set your PowerShell execution policy
RUN powershell Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
# Install Chocolatey
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
# Install Chocolatey packages
RUN choco install -y git.install -params '"/GitAndUnixToolsOnPath"' && \
choco install -y openssh && \
choco install -y golang
# Hack for mounting in code later (Use G:)
# See https://github.com/moby/moby/issues/27537#issuecomment-271546031
VOLUME c:/data
RUN powershell set-itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices' -Name 'G:' -Value '\??\C:\data' -Type String
# Copy across the agent source
ENV GOPATH=c:/gopath
WORKDIR c:/gopath/src/github.com/buildkite/agent
COPY . .
# Build agent and put binary in a dir in the PATH (remarkably hard to add to path)
RUN go build -i -o .\buildkite-agent.exe
CMD ["./buildkite-agent.exe", "start"]