Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 2.08 KB

README.md

File metadata and controls

28 lines (22 loc) · 2.08 KB

Building Docker Image

This directory contains the necessary files for building a Docker Images. There is a Windows based image which runs choco on .NET and a Linux based image that builds and runs choco with Mono.

To build the Windows image yourself, follow these steps:

  1. Clone down the repository on a Windows system using git clone https://github.com/chocolatey/choco.git.
  2. Change directories to the root of the repository.
  3. 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.
  4. Run the docker build command. docker build -t choco:latest-windows -f docker/Dockerfile.windows . (the trailing . is important)
    • 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.
  5. Run your new image using the command docker run -ti --rm choco:latest-windows cmd.exe
  6. Test choco by running choco -h. You should see the help message from choco.exe.

To build the Linux image yourself, follow these steps:

  1. Clone down the repository using git clone https://github.com/chocolatey/choco.git.
  2. Change directories to the root of the repository.
  3. Run the docker build command. docker build -t choco:latest-linux -f docker/Dockerfile.linux . (the trailing . is important)
    • To build a official version, use this command: docker build -t chocolatey/choco:latest-linux -f docker/Dockerfile.linux . --build-arg buildscript=build.official.sh
    • To build a debug version, add the argument --build-arg buildscript=build.debug.sh
    • To change the version of mono used, add the argument --build-arg monoversion=mono-tag
  4. Run your new image using the command docker run -ti --rm choco:latest-linux /bin/bash
  5. Test choco by running choco -h. You should see the help message from choco.exe.