Skip to content

Commit

Permalink
Added a Dockerfile to run gitsome in a Docker container
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
  • Loading branch information
l0rd committed Dec 2, 2016
1 parent d59948b commit 865d262
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 865d262

Please sign in to comment.