Public Repository

Last pushed: 13 days ago
Short Description
Chocolatey package manager in a Windows Docker image
Full Description

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 :-)

Docker Pull Command

Comments (2)
5 months ago

Added a link to the Dockerfile. Most of my Windows Docker images can be found at

5 months ago

It is possible for you to post the dockerfile that created this image, or a github repo with it? This aligns with what I am trying to do, but I need to have more control over the base image. Thanks!