diff --git a/Dockerfile b/Dockerfile index 8259bb0..2d9509f 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,12 @@ FROM node:8.2.1-alpine ENV GTT_VERSION 1.7.39 +ENV EDITOR vi + +WORKDIR /pwd RUN yarn global add --prefix /usr/local "gitlab-time-tracker@$GTT_VERSION" -VOLUME ["/root"] +VOLUME ["/root", "/pwd"] ENTRYPOINT ["gtt"] CMD ["--help"] diff --git a/documentation.md b/documentation.md index 01a2e94..41fe224 100644 --- a/documentation.md +++ b/documentation.md @@ -70,12 +70,13 @@ you can use the official [Docker image](https://hub.docker.com/r/kriskbx/gitlab- docker run \ --rm -it \ -v ~:/root \ + -v $(pwd):/pwd \ kriskbx/gitlab-time-tracker \ --help ``` `--rm` removes the container after running, `-it` makes it interactive, `-v ~:/root` mounts your home directory to the -home directory inside the container. If you want to store the config in another place, mount another directory: +home directory inside the container, `-v $(pwd):/pwd` mounts current directory inside the container to gtt be able to read local config. If you want to store the config in another place, mount another directory: ```shell @@ -101,7 +102,7 @@ docker run \ I highly recommend creating an alias and adding it to your `bashrc`: ```shell -echo "alias gtt='docker run --rm -it -v ~:/root kriskbx/gitlab-time-tracker'" >>~/.bashrc +echo "alias gtt='docker run --rm -it -v ~:/root -v $(pwd):/pwd kriskbx/gitlab-time-tracker'" >>~/.bashrc ``` Now you can simply write `gtt` instead of the bulky Docker command before. Try it out: `gtt --help`