Skip to content

Commit

Permalink
Reuse servercore layers for nanoserver builds
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre authored Apr 29, 2024
1 parent eb15367 commit 9e921bd
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 51 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,3 @@ jobs:
- name: Test
run: .\.ci\test.ps1 -target 'servercore-ltsc2022'
shell: powershell

docker-library-winnano2022:
name: Test on windows nano server 2022
runs-on: windows-2022

steps:

- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Test
run: .\.ci\test.ps1 -target 'nanoserver-ltsc2022'
shell: powershell
13 changes: 1 addition & 12 deletions windows/nanoserver-ltsc2022/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# Installer image, needed for Invoke-WebRequest
FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS installer
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

RUN Invoke-WebRequest \
-Uri "https://github.com/traefik/traefik/releases/download/v3.0.0/traefik_v3.0.0_windows_amd64.zip" \
-OutFile "/traefik.zip"; \
Expand-Archive -Path "/traefik.zip" -DestinationPath "/" -Force; \
Remove-Item "/traefik.zip" -Force

# Runner image
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022

COPY --from=installer /traefik.exe /
COPY --from=traefik:v3.0.0-windowsservercore-ltsc2022 /traefik.exe /

EXPOSE 80
ENTRYPOINT [ "/traefik" ]
Expand Down
13 changes: 1 addition & 12 deletions windows/nanoserver-ltsc2022/tmplv2.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# Installer image, needed for Invoke-WebRequest
FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS installer
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

RUN Invoke-WebRequest \
-Uri "https://github.com/traefik/traefik/releases/download/${VERSION}/traefik_${VERSION}_windows_amd64.zip" \
-OutFile "/traefik.zip"; \
Expand-Archive -Path "/traefik.zip" -DestinationPath "/" -Force; \
Remove-Item "/traefik.zip" -Force

# Runner image
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022

COPY --from=installer /traefik.exe /
COPY --from=traefik:${VERSION}-windowsservercore-ltsc2022 /traefik.exe /

EXPOSE 80
ENTRYPOINT [ "/traefik" ]
Expand Down
13 changes: 1 addition & 12 deletions windows/nanoserver-ltsc2022/tmplv3.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# Installer image, needed for Invoke-WebRequest
FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS installer
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

RUN Invoke-WebRequest \
-Uri "https://github.com/traefik/traefik/releases/download/${VERSION}/traefik_${VERSION}_windows_amd64.zip" \
-OutFile "/traefik.zip"; \
Expand-Archive -Path "/traefik.zip" -DestinationPath "/" -Force; \
Remove-Item "/traefik.zip" -Force

# Runner image
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022

COPY --from=installer /traefik.exe /
COPY --from=traefik:${VERSION}-windowsservercore-ltsc2022 /traefik.exe /

EXPOSE 80
ENTRYPOINT [ "/traefik" ]
Expand Down

0 comments on commit 9e921bd

Please sign in to comment.