Sign inSign up

stefanscherer/chocolatey

By stefanscherer

•Updated about 7 years ago

Chocolatey package manager in a Windows Docker image

Image
10

8.0K

stefanscherer/chocolatey repository overview

⁠Chocolatey package manager

This is a Windows Docker image with the Chocolatey package manager.

⁠Use cases

⁠Drafting own Dockerfiles

For some very simple Docker images you can use the Chocolatey package manager inside a Windows Container.

FROM stefanscherer/chocolatey
RUN choco install -y php
RUN php --version

These Docker images may be bigger than installing the tools manually and optimizing the size, but your Dockerfile will look very simple and easy to understand.

⁠Build Choco packages

If you do not have a Windows machine at hand but you want to build an own Chocolatey package, you can use this in combination with a Windows Docker machine⁠ eg. from a Mac.

Let's say you have your nuget file and install ps1 script in your current directory, you can run this command to build the Chocolatey package file:

$ docker run -v C:$(pwd):C:/choco stefanscherer/chocolatey \
   powershell -Command 'cd c:\choco ; choco pack ; .\test.ps1'

This bind mounts the current Mac directory to C:\choco in the Windows container and you can run choco pack with it. The resulting nupkg file is then in your Mac's current directory :-)

Tag summary

Content type

Image

Digest

Size

2 GB

Last updated

about 7 years ago

docker pull stefanscherer/chocolatey