Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit c4692a5

Browse files
authored
Add pwd to docker container (#108)
* add pwd * add pwd doc * add editor env
1 parent a54d623 commit c4692a5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
FROM node:8.2.1-alpine
22

33
ENV GTT_VERSION 1.7.39
4+
ENV EDITOR vi
5+
6+
WORKDIR /pwd
47

58
RUN yarn global add --prefix /usr/local "gitlab-time-tracker@$GTT_VERSION"
69

7-
VOLUME ["/root"]
10+
VOLUME ["/root", "/pwd"]
811
ENTRYPOINT ["gtt"]
912
CMD ["--help"]

documentation.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@ you can use the official [Docker image](https://hub.docker.com/r/kriskbx/gitlab-
7070
docker run \
7171
--rm -it \
7272
-v ~:/root \
73+
-v $(pwd):/pwd \
7374
kriskbx/gitlab-time-tracker \
7475
--help
7576
```
7677

7778
`--rm` removes the container after running, `-it` makes it interactive, `-v ~:/root` mounts your home directory to the
78-
home directory inside the container. If you want to store the config in another place, mount another directory:
79+
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:
7980

8081

8182
```shell
@@ -101,7 +102,7 @@ docker run \
101102
I highly recommend creating an alias and adding it to your `bashrc`:
102103

103104
```shell
104-
echo "alias gtt='docker run --rm -it -v ~:/root kriskbx/gitlab-time-tracker'" >>~/.bashrc
105+
echo "alias gtt='docker run --rm -it -v ~:/root -v $(pwd):/pwd kriskbx/gitlab-time-tracker'" >>~/.bashrc
105106
```
106107

107108
Now you can simply write `gtt` instead of the bulky Docker command before. Try it out: `gtt --help`

0 commit comments

Comments
 (0)