Skip to content

Commit

Permalink
(#3020) Uses the Dotnet Image as the basis for the Windows image
Browse files Browse the repository at this point in the history
This should fix the Docker Windows for Chocolatey 2.0+, which is currently failing due to the inability to install 4.8 during the Docker steps.

On top of this, the Arg has been misbehaving with Amazon's version of Docker. As we only intend to build the 2016 LTSC version at the moment, I have removed this until the issue is solved.
  • Loading branch information
JPRuskin authored and gep13 committed Mar 16, 2023
1 parent 01fcdda commit 0392c33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions docker/Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG tagversion="ltsc2016"
FROM mcr.microsoft.com/windows/servercore:${tagversion}
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2016

LABEL org.opencontainers.image.url="https://chocolatey.org/"
LABEL org.opencontainers.image.documentation="https://docs.chocolatey.org/"
Expand All @@ -9,7 +8,7 @@ LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.title="Chocolatey"
LABEL org.opencontainers.image.description="Chocolatey Client running on .NET"
LABEL org.opencontainers.image.authors="https://chocolatey.org/support"
LABEL org.opencontainers.image.base.name="mcr.microsoft.com/windows/servercore:${tagversion}"
LABEL org.opencontainers.image.base.name="mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2016"

COPY ./code_drop/Packages/Chocolatey C:/choco-nupkg
COPY ./docker/Install-ChocolateyInContainer.ps1 C:/choco-nupkg/Install-ChocolateyInContainer.ps1
Expand Down
1 change: 0 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ To build the Windows image yourself, follow these steps:
1. Either build choco on the host or put a pre-built chocolatey `.nupkg` in `.\code_drop\Packages\Chocolatey`.
* See the README at the root of the repository for instructions on how to build choco.
1. Run the docker build command. `docker build -t choco:latest-windows -f docker/Dockerfile.windows .` (the trailing . is important)
* To change the version of the servercore image used, add the argument `--build-arg tagversion=servercore-tag`
* To build a official version, put an official `.nupkg` in `.\code_drop\Packages\Chocolatey` and change the image name to `chocolatey/choco:latest-windows`
* If you get messages similar to "Can't add file x to tar: archive/tar: missed writing 794 bytes", make sure Visual Studio is closed.
1. Run your new image using the command `docker run -ti --rm choco:latest-windows cmd.exe`
Expand Down

0 comments on commit 0392c33

Please sign in to comment.