mirror of
https://github.com/drone-plugins/drone-docker.git
synced 2026-07-16 16:21:18 +08:00
Compare commits
3 Commits
v21.2.9-debug
...
v21.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 65a576e26b | |||
| 994fe7a8e4 | |||
| 35365e35c8 |
@@ -3,15 +3,17 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2025 as download
|
|||||||
|
|
||||||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
|
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
|
||||||
|
|
||||||
ENV DOCKER_VERSION 19.03.1
|
# Modernized for ltsc2025: fetch the standalone Docker CLI matching the daemon
|
||||||
|
# generation used on Windows Server 2025 hosts (28.x). Replaces the 1809/ltsc2022
|
||||||
RUN Invoke-WebRequest 'http://constexpr.org/innoextract/files/innoextract-1.7-windows.zip' -OutFile 'innoextract.zip' -UseBasicParsing ; `
|
# pattern of extracting docker.exe from DockerToolbox 19.03.1 via innoextract.
|
||||||
Expand-Archive innoextract.zip -DestinationPath C:\ ; `
|
ENV DOCKER_VERSION 28.4.0
|
||||||
Remove-Item -Path innoextract.zip
|
|
||||||
|
|
||||||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
|
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
|
||||||
Invoke-WebRequest $('https://github.com/docker/toolbox/releases/download/v{0}/DockerToolbox-{0}.exe' -f $env:DOCKER_VERSION) -OutFile 'dockertoolbox.exe' -UseBasicParsing
|
Invoke-WebRequest -UseBasicParsing `
|
||||||
RUN /innoextract.exe dockertoolbox.exe
|
$('https://download.docker.com/win/static/stable/x86_64/docker-{0}.zip' -f $env:DOCKER_VERSION) `
|
||||||
|
-OutFile docker.zip ; `
|
||||||
|
Expand-Archive docker.zip -DestinationPath C:\ ; `
|
||||||
|
Remove-Item docker.zip
|
||||||
|
|
||||||
FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
|
FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
|
||||||
USER ContainerAdministrator
|
USER ContainerAdministrator
|
||||||
@@ -26,7 +28,9 @@ RUN mkdir C:\bin
|
|||||||
# Install cosign for container image signing
|
# Install cosign for container image signing
|
||||||
ADD https://github.com/sigstore/cosign/releases/download/v2.5.3/cosign-windows-amd64.exe C:/bin/cosign.exe
|
ADD https://github.com/sigstore/cosign/releases/download/v2.5.3/cosign-windows-amd64.exe C:/bin/cosign.exe
|
||||||
|
|
||||||
COPY --from=download /windows/system32/netapi32.dll /windows/system32/netapi32.dll
|
# nanoserver:ltsc2025 ships netapi32.dll natively (unlike 1809/ltsc2022 where we
|
||||||
COPY --from=download /app/docker.exe C:/bin/docker.exe
|
# had to copy it in from servercore). Overwriting the ltsc2025 copy fails with
|
||||||
|
# "Access is denied" because system32 files are locked, so we skip that COPY.
|
||||||
|
COPY --from=download /docker/docker.exe C:/bin/docker.exe
|
||||||
ADD release/windows/amd64/drone-docker.exe C:/bin/drone-docker.exe
|
ADD release/windows/amd64/drone-docker.exe C:/bin/drone-docker.exe
|
||||||
ENTRYPOINT [ "C:\\bin\\drone-docker.exe" ]
|
ENTRYPOINT [ "C:\\bin\\drone-docker.exe" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user