From 865d262591d11e16b84c20c36fdf8ab9ae4c9175 Mon Sep 17 00:00:00 2001 From: Mario Loriedo Date: Fri, 2 Dec 2016 02:08:49 +0100 Subject: [PATCH] Added a Dockerfile to run gitsome in a Docker container Signed-off-by: Mario Loriedo --- Dockerfile | 26 ++++++++++++++++++++++++++ README.md | 32 +++++++++++++++++++++++++++++++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c9b7b44 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +########################################################## +# # +# Build the image: # +# docker build -t gitsome . # +# # +# Run the container: # +# docker run -ti --rm -v $(pwd):/src/ \ # +# -v ${HOME}/.gitsomeconfig:/root/.gitsomeconfig \ # +# -v ${HOME}/.gitconfig:/root/.gitconfig \ # +# gitsome # +# # +########################################################## +FROM python:3.5 + +RUN pip install Pillow + +COPY /requirements-dev.txt /gitsome/ +WORKDIR /gitsome/ +RUN pip install -r requirements-dev.txt + +COPY / /gitsome/ +RUN pip install -e . + +RUN mkdir /src/ +WORKDIR /src/ +ENTRYPOINT ["gitsome"] diff --git a/README.md b/README.md index e8779af..7ad9b2c 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,8 @@ For no color, set the value(s) to `None`. `white` can appear as light gray on s ## Available Platforms -`gitsome` is available for Mac, Linux, Unix, and [Windows](#windows-support). +`gitsome` is available for Mac, Linux, Unix, [Windows](#windows-support) and +[Docker](#running-as-docker-container). ## TODO @@ -176,6 +177,7 @@ For no color, set the value(s) to `None`. `white` can appear as light gray on s * [Installation](#installation) * [Pip Installation](#pip-installation) * [Virtual Environment Installation](#virtual-environment-installation) + * [Running as Docker container](#running-as-docker-container) * [Running the `gh configure` Command](#running-the-gh-configure-command) * [For GitHub Enterprise Users](#for-github-enterprise-users) * [Enabling Bash Completions](#enabling-bash-completions) @@ -548,6 +550,34 @@ To deactivate the `gitsome` `virtualenv`, run: $ deactivate +### Running as Docker Container + +You can run gitsome in a Docker container to avoid installing Python and pip locally. To install Docker check out the [official Docker documentation](https://docs.docker.com/engine/getstarted/step_one/#step-1-get-docker). + +Once you have docker installed you can run gitsome: + + $ docker run -ti --rm mariolet/gitsome + +You can use Docker volumes to let gitsome access your working directory, your local .gitsomeconfig and .gitconfig: + + $ docker run -ti --rm -v $(pwd):/src/ \ + -v ${HOME}/.gitsomeconfig:/root/.gitsomeconfig \ + -v ${HOME}/.gitconfig:/root/.gitconfig \ + mariolet/gitsome + +If you are running this command often you will probably want to define an alias: + + $ alias gitsome="docker run -ti --rm -v $(pwd):/src/ \ + -v ${HOME}/.gitsomeconfig:/root/.gitsomeconfig \ + -v ${HOME}/.gitconfig:/root/.gitconfig \ + mariolet/gitsome" + +To build the Docker image from sources: + + $ git clone https://github.com/donnemartin/gitsome.git + $ cd gitsome + $ docker build -t gitsome . + ### Starting the `gitsome` Shell Once installed, run the optional `gitsome` autocompleter with interactive help: