From 3ec1133e7f5c4958d01889de942d081ccb2bfa64 Mon Sep 17 00:00:00 2001 From: Justin Phelps Date: Tue, 31 Jan 2017 15:10:33 -0800 Subject: [PATCH] (maint) Add ability to build a Docker image. Adds a dockerfile for the mono choco build. Adds the wrapper Bash script for easier choco commands in the container. Stores assets in a docker subfolder. Adds documentation on how to build the image yourself. --- docker/Dockerfile.linux | 17 +++++++++++++++++ docker/README.md | 12 ++++++++++++ docker/choco_wrapper | 3 +++ 3 files changed, 32 insertions(+) create mode 100644 docker/Dockerfile.linux create mode 100644 docker/README.md create mode 100755 docker/choco_wrapper diff --git a/docker/Dockerfile.linux b/docker/Dockerfile.linux new file mode 100644 index 0000000000..1dea04ead9 --- /dev/null +++ b/docker/Dockerfile.linux @@ -0,0 +1,17 @@ +FROM mono:3.12.1 + +MAINTAINER Justin Phelps + +COPY . /usr/local/src/choco/ + +WORKDIR /usr/local/src/choco +RUN chmod +x build.sh +RUN chmod +x zip.sh +RUN ./build.sh + +WORKDIR /usr/local/bin +RUN ln -s /usr/local/src/choco/build_output/chocolatey + +COPY docker/choco_wrapper /usr/local/bin/choco + +WORKDIR /root diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000000..504a96261a --- /dev/null +++ b/docker/README.md @@ -0,0 +1,12 @@ +Building Docker Image +===================== + +This directory contains the necessary Dockerfile and wrapper script for building a Docker Image. This is a Linux based image that builds and runs choco.exe with mono. + +To build this image yourself, follow these steps: + +1. Clone down the repository using `git clone https://github.com/chocolatey/choco.git`. +1. Change directories to the root of the repository. +1. Run the docker build command. `docker build -t mono-choco -f docker/Dockerfile.linux .` (the trailing . is important) +1. Run your new image using the command `docker run -ti --rm mono-choco /bin/bash` +1. Test choco by running `choco -h`. You should see the help message from choco.exe. diff --git a/docker/choco_wrapper b/docker/choco_wrapper new file mode 100755 index 0000000000..3aa86b5e5c --- /dev/null +++ b/docker/choco_wrapper @@ -0,0 +1,3 @@ +#!/bin/bash + +mono /usr/local/bin/chocolatey/choco.exe "$@" --allow-unofficial