Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Dockerfile to run gitsome in a Docker container #99

Merged
merged 1 commit into from
Dec 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we combine lines 124 and 125 into a single line?


## 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)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we capitalize "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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "Running as a Docker Container"? If we make this change, please update line 180


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