Skip to content

Commit

Permalink
update README (grafana#106)
Browse files Browse the repository at this point in the history
- make doc more understandable
- add `-d` for `docker run` to support run in the backgroud

Signed-off-by: Xiang Dai <[email protected]>
  • Loading branch information
daixiang0 authored and gouthamve committed Dec 14, 2018
1 parent d75ce9e commit 86fbdc0
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,33 @@ The Docker images for [Loki](https://hub.docker.com/r/grafana/loki/) and [Promta

To test locally using `docker run`:

1. Create a Docker network that the Docker containers can share:
1. git clone this repo locally
```bash
git clone https://github.com/grafana/loki.git
cd loki
```

2. Create a Docker network that the Docker containers can share:
```bash
docker network create loki
```

2. Start the Loki server:
3. Start the Loki server:
```bash
docker run --name loki --network=loki -p 3100:3100 --volume "$PWD/docs:/etc/loki" grafana/loki:master -config.file=/etc/loki/loki-local-config.yaml
docker run -d --name loki --network=loki -p 3100:3100 --volume "$PWD/docs:/etc/loki" grafana/loki:master -config.file=/etc/loki/loki-local-config.yaml
```

3. Then start the Promtail agent. The default config polls the contents of your `/var/log` directory.
4. Then start the Promtail agent. The default config polls the contents of your `/var/log` directory.
```bash
docker run --name promtail --network=loki --volume "$PWD/docs:/etc/promtail" --volume "/var/log:/var/log" grafana/promtail:master -config.file=/etc/promtail/promtail-docker-config.yaml
docker run -d --name promtail --network=loki --volume "$PWD/docs:/etc/promtail" --volume "/var/log:/var/log" grafana/promtail:master -config.file=/etc/promtail/promtail-docker-config.yaml
```

4. If you also want to run Grafana in docker:
5. If you also want to run Grafana in docker:
```bash
docker run --name grafana --network=loki -p 3000:3000 -e "GF_EXPLORE_ENABLED=true" grafana/grafana:master
docker run -d --name grafana --network=loki -p 3000:3000 -e "GF_EXPLORE_ENABLED=true" grafana/grafana:master
```

5. Follow the steps for configuring the datasource in Grafana in the section below and set the URL field to: `http://loki:3100`
6. Follow the steps for configuring the datasource in Grafana in the section below and set the URL field to: `http://loki:3100`

Another option is to use the docker-compose file in the docs directory:

Expand Down

0 comments on commit 86fbdc0

Please sign in to comment.