-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwindows-git-plugin.Dockerfile
More file actions
41 lines (36 loc) · 1.63 KB
/
windows-git-plugin.Dockerfile
File metadata and controls
41 lines (36 loc) · 1.63 KB
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
# syntax = docker/dockerfile:1
# escape=`
FROM opencloudeu/woodpecker-windows-chocolatey:latest
# Woodpecker plugin-git https://github.com/woodpecker-ci/plugin-git
ARG PLUGIN_VERSION=2.6.5 `
PLUGIN_VERSION_SHA256=23fd58af7a0e90c81436218d407a255ac686bb1b91a1d2dbe62e43a8acd3fdbc
LABEL maintainer="OpenCloud.eu Team <devops@opencloud.eu>" `
name="opencloudeu/woodpecker-windows-git-plugin" `
vendor="OpenCloud GmbH" `
source="https://github.com/opencloud-eu/containers-woodpecker-windows"
RUN `
# Install git with chocolatey
C:\\ProgramData\\chocolatey\\bin\\choco.exe install -y git `
&& Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 `
&& refreshenv `
# cleanup
&& Remove-Item @( `
'C:\tmp\cache', `
'C:\Windows\Temp\*', `
'C:\Windows\Prefetch\*', `
'C:\Documents and Settings\*\Local Settings\temp\*', `
'C:\Users\*\Appdata\Local\Temp\*' ) `
-Force -Recurse -Verbose -ErrorAction SilentlyContinue `
New-item -type directory C:\bin ; `
# Install Woodpecker git-plugin
Invoke-WebRequest -OutFile "C:\bin\plugin-git.exe" `
-Uri https://github.com/woodpecker-ci/plugin-git/releases/download/$env:PLUGIN_VERSION/windows-amd64_plugin-git.exe ; `
# check digest
$actual=(Get-FileHash -Algorithm SHA256 "C:\bin\plugin-git.exe").Hash.ToLower(); `
if ($actual -ne $env:PLUGIN_VERSION_SHA256) { throw "SHA256 mismatch" } ; `
$env:PATH += ';C:\bin'; `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH,[EnvironmentVariableTarget]::Machine)
USER ContainerUser
ENV GODEBUG=netdns=go
WORKDIR C:\woodpecker
ENTRYPOINT ["plugin-git.exe"]