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 pwd to docker container #108

Merged
merged 6 commits into from
Jun 3, 2020
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
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
5 changes: 3 additions & 2 deletions documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Choose a reason for hiding this comment

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

The correct env variables is PWD, env vars are case sensitive so this will not work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We are not using an env vars here, but the output of the pwd command. Please note use of parentheses $(pwd), not accolades ${pwd}



```shell
Expand All @@ -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`
Expand Down