Skip to content

Commit

Permalink
Remove container after use (#110)
Browse files Browse the repository at this point in the history
* Update docker run command to remove the container after use

* Update README for [email protected]
  • Loading branch information
goyalmunish authored Apr 16, 2022
1 parent 5169ecb commit 1467115
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,27 @@ Additionally, from the **Main Menu**:
_This is the easiest way to get going, if you have [Docker](https://docs.docker.com/get-docker/) installed. Just download the [`reminder` image](https://hub.docker.com/r/goyalmunish/reminder/tags) by issuing the following commands:_

```sh
# pull the image
# pull the image (or get the latest image)
docker pull goyalmunish/reminder

# make sure the directory for the data file exists on the host machine
mkdir -p ~/reminder

# spin up the container, with data file shared from the host machine
docker run -it -v ~/reminder:/root/reminder goyalmunish/reminder
docker run -it --rm --name reminder -v ~/reminder:/root/reminder goyalmunish/reminder
```

_For subsequent runs, better add the below alias to `~/.bashrc` ( or `~/.zshrc`, etc), so that you can invoke the tool, just by typing `reminder`:_
_For subsequent runs, better add the below alias to `~/.bashrc` ( or `~/.zshrc`, etc), so that you can invoke the tool, just by typing `reminder` (or any other alias that you prefer):_

```sh
alias reminder='docker run -it -v ~/reminder:/root/reminder goyalmunish/reminder'
# define the alias
alias reminder='docker run -it --rm --name reminder -v ~/reminder:/root/reminder goyalmunish/reminder'
```

_Run the tool:_

```sh
# run the tool
reminder
```

Expand All @@ -148,7 +150,7 @@ reminder
On Mac, you can just install it with `brew` as:

```sh
brew install golang
brew install [email protected]
```

For other platforms, check [official `go` download and install guide](https://golang.org/dl/).
Expand All @@ -172,9 +174,14 @@ If this results in Permission issues, such as `[email protected]: Permission denied
Install the tool as:

```sh
# cd into the local copy of the repo
cd reminder

# install the tool
go install ./cmd/reminder
mv ${GOPATH}/bin/reminder ${GOPATH}/bin/reminder

# move the binary to /usr/local/bin/
mv ${GOPATH}/bin/reminder /usr/local/bin/reminder
```

#### Run the tool
Expand All @@ -185,9 +192,13 @@ If you have installed the tool, and your `go/bin` path is alreay in `PATH`, then
reminder
```

Otherwise, you can just run it as:
Otherwise, you can just run it as (without installing, directly from clone of the repo):

```sh
# cd into the local copy of the repo
cd reminder

# running the tool using `make`
make run

# or as
Expand Down
1 change: 1 addition & 0 deletions scripts/run_via_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker run -it --rm --name reminder -v ~/reminder:/root/reminder goyalmunish/reminder

0 comments on commit 1467115

Please sign in to comment.