From 7f04fc95c011c68b4f87484ba34fff9382f1a007 Mon Sep 17 00:00:00 2001 From: Kyle Galloway Date: Mon, 7 Oct 2019 15:19:25 -0500 Subject: [PATCH] build: Add Dockerfile and add docker instructions to README.md --- Dockerfile | 9 +++++++++ README.md | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1bc5ba7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM rust:latest + +ENV SRC_DIR /src +RUN mkdir $SRC_DIR +WORKDIR $SRC_DIR +VOLUME $SRC_DIR + +CMD ["/bin/bash"] + diff --git a/README.md b/README.md index 72adeac..345b5e1 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,25 @@ dumb_terminal = ["colored/no-color"] You can use have even finer control by using the `colored::control::set_override` method. +## Build with Docker + +### Install Docker + +Use the install instructions located [here](https://docs.docker.com/v17.12/install/) + +### Build the Docker image + +```docker build -t colored_image .``` + +### Build the library + +```docker run --rm -it -v "$PWD":/src -u `id -u`:`id -g` colored_image /bin/bash -c "cargo build"``` + +### Test the library + +```docker run --rm -it -v "$PWD":/src -u `id -u`:`id -g` colored_image /bin/bash -c "cargo test"``` + + ## Todo - **More tests ?**: We always welcome more tests! Please contribute!