Skip to content

Commit afbeedc

Browse files
authored
docs: Update docker installation topic (#12770)
1 parent fd2301f commit afbeedc

File tree

2 files changed

+127
-53
lines changed

2 files changed

+127
-53
lines changed

docs/sources/send-data/promtail/installation.md

+36-27
Original file line numberDiff line numberDiff line change
@@ -23,43 +23,52 @@ See the instructions [here](https://grafana.com/docs/loki/<LOKI_VERSION>/setup/i
2323

2424
## Install using Docker
2525

26-
```bash
27-
# modify tag to most recent version
28-
docker pull grafana/promtail:2.9.2
29-
```
26+
1. Make sure to modify the tag to the most recent version.
27+
28+
```bash
29+
docker pull grafana/promtail:3.0.0
30+
```
31+
32+
1. Create your Promtail configuration file in a file called `promtail-config.yaml`. Refer to the [Promtail configuration reference](https://grafana.com/docs/loki/<LOKI_VERSION>/send-data/promtail/configuration/) for more details.
33+
34+
1. Note that you will need to replace `<local-path>` in the commands with your local path.
35+
36+
```bash
37+
docker run -v <local-path>:/mnt/config -v /var/log:/var/log --link loki grafana/promtail:3.0.0 --config.file=/mnt/config/promtail-config.yaml
38+
```
3039

3140
## Install using Helm
3241

33-
Make sure that Helm is installed.
34-
See [Installing Helm](https://helm.sh/docs/intro/install/).
35-
Then you can add Grafana's chart repository to Helm:
42+
1. Make sure that Helm is installed. See [Installing Helm](https://helm.sh/docs/intro/install/).
3643

37-
```bash
38-
helm repo add grafana https://grafana.github.io/helm-charts
39-
```
44+
1. Then you can add Grafana's chart repository to Helm:
4045
41-
And the chart repository can be updated by running:
46+
```bash
47+
helm repo add grafana https://grafana.github.io/helm-charts
48+
```
4249
43-
```bash
44-
helm repo update
45-
```
50+
1. Update the chart repository:
4651
47-
Create the configuration file `values.yaml`. The example below illustrates a connection to the locally deployed loki server:
52+
```bash
53+
helm repo update
54+
```
4855
49-
```yaml
50-
config:
51-
# publish data to loki
52-
clients:
53-
- url: http://loki-gateway/loki/api/v1/push
54-
tenant_id: 1
55-
```
56+
1. Create the configuration file `values.yaml`. The example below illustrates a connection to the locally deployed loki server:
5657
57-
Finally, Promtail can be deployed with:
58+
```yaml
59+
config:
60+
# publish data to loki
61+
clients:
62+
- url: http://loki-gateway/loki/api/v1/push
63+
tenant_id: 1
64+
```
5865
59-
```bash
60-
# The default helm configuration deploys promtail as a daemonSet (recommended)
61-
helm upgrade --values values.yaml --install promtail grafana/promtail
62-
```
66+
1. Finally, Promtail can be deployed with:
67+
68+
```bash
69+
# The default helm configuration deploys promtail as a daemonSet (recommended)
70+
helm upgrade --values values.yaml --install promtail grafana/promtail
71+
```
6372
6473
## Install as Kubernetes daemonSet (recommended)
6574

docs/sources/setup/install/docker.md

+91-26
Original file line numberDiff line numberDiff line change
@@ -9,55 +9,120 @@ weight: 400
99
# Install Loki with Docker or Docker Compose
1010

1111
You can install Loki and Promtail with Docker or Docker Compose if you are evaluating, testing, or developing Loki.
12-
For production, Grafana recommends installing with Tanka or Helm.
12+
For production, Grafana recommends installing with Helm or Tanka.
1313

14-
The configuration acquired with these installation instructions run Loki as a single binary.
14+
The configuration files associated with these installation instructions run Loki as a single binary.
1515

1616
## Prerequisites
1717

1818
- [Docker](https://docs.docker.com/install)
1919
- [Docker Compose](https://docs.docker.com/compose/install) (optional, only needed for the Docker Compose install method)
2020

21-
## Install with Docker
21+
## Install with Docker on Linux
2222

23-
**Linux**
23+
1. Create a directory called `loki`. Make `loki` your current working directory:
2424

25-
Copy and paste the commands below into your command line.
25+
```bash
26+
mkdir loki
27+
cd loki
28+
```
2629

27-
```bash
28-
wget https://raw.githubusercontent.com/grafana/loki/v2.9.2/cmd/loki/loki-local-config.yaml -O loki-config.yaml
29-
docker run --name loki -d -v $(pwd):/mnt/config -p 3100:3100 grafana/loki:2.9.2 -config.file=/mnt/config/loki-config.yaml
30-
wget https://raw.githubusercontent.com/grafana/loki/v2.9.2/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
31-
docker run --name promtail -d -v $(pwd):/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.9.2 -config.file=/mnt/config/promtail-config.yaml
32-
```
30+
1. Copy and paste the following commands into your command line to download `loki-local-config.yaml` and `promtail-docker-config.yaml` to your `loki` directory.
31+
32+
```bash
33+
wget https://raw.githubusercontent.com/grafana/loki/v3.0.0/cmd/loki/loki-local-config.yaml -O loki-config.yaml
34+
wget https://raw.githubusercontent.com/grafana/loki/v3.0.0/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
35+
```
36+
37+
1. Copy and paste the following commands into your command line to start the Docker containers using the configuration files you downloaded in the previous step.
38+
39+
```bash
40+
docker run --name loki -d -v $(pwd):/mnt/config -p 3100:3100 grafana/loki:3.0.0 -config.file=/mnt/config/loki-config.yaml
41+
docker run --name promtail -d -v $(pwd):/mnt/config -v /var/log:/var/log --link loki grafana/promtail:3.0.0 -config.file=/mnt/config/promtail-config.yaml
42+
```
43+
44+
{{< admonition type="note" >}}
45+
The image is configured to run by default as user `loki` with UID `10001` and GID `10001`. You can use a different user, specially if you are using bind mounts, by specifying the UID with a `docker run` command and using `--user=UID` with a numeric UID suited to your needs.
46+
{{< /admonition >}}
47+
48+
1. Verify that your containers are running:
3349

34-
When finished, `loki-config.yaml` and `promtail-config.yaml` are downloaded in the directory you chose. Docker containers are running Loki and Promtail using those config files.
50+
```bash
51+
docker container ls
52+
```
3553

36-
Navigate to http://localhost:3100/metrics to view the metrics and http://localhost:3100/ready for readiness.
54+
You should see something similar to the following:
3755

38-
The image is configured to run by default as user loki with UID `10001` and GID `10001`. You can use a different user, specially if you are using bind mounts, by specifying the UID with a `docker run` command and using `--user=UID` with numeric UID suited to your needs.
56+
```bash
3957
40-
**Windows**
58+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
59+
9485de9ad351 grafana/promtail:3.0.0 "/usr/bin/promtail -…" About a minute ago Up About a minute promtail
60+
cece1df84519 grafana/loki:3.0.0 "/usr/bin/loki -conf…" About a minute ago Up About a minute 0.0.0.0:3100->3100/tcp, :::3100->3100/tcp loki
61+
```
4162

42-
Copy and paste the commands below into your terminal. Note that you will need to replace the `<placeholders>` in the commands with your local path.
63+
1. Verify that Loki is up and running.
64+
65+
- To view readiness, navigate to http://localhost:3100/ready.
66+
- To view metrics, navigate to http://localhost:3100/metrics.
67+
68+
## Install with Docker on Windows
69+
70+
1. Copy and paste the following commands into your command line to download `loki-local-config.yaml` and `promtail-docker-config.yaml` to your `loki` directory. Note that you will need to replace the `<local-path>` in the commands with your local path.
4371

4472
```bash
4573
cd "<local-path>"
46-
wget https://raw.githubusercontent.com/grafana/loki/v2.9.2/cmd/loki/loki-local-config.yaml -O loki-config.yaml
47-
docker run --name loki -v <local-path>:/mnt/config -p 3100:3100 grafana/loki:2.9.2 --config.file=/mnt/config/loki-config.yaml
48-
wget https://raw.githubusercontent.com/grafana/loki/v2.9.2/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
49-
docker run -v <local-path>:/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.9.2 --config.file=/mnt/config/promtail-config.yaml
74+
wget https://raw.githubusercontent.com/grafana/loki/v3.0.0/cmd/loki/loki-local-config.yaml -O loki-config.yaml
75+
wget https://raw.githubusercontent.com/grafana/loki/v3.0.0/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
5076
```
5177

52-
When finished, `loki-config.yaml` and `promtail-config.yaml` are downloaded in the directory you chose. Docker containers are running Loki and Promtail using those config files.
78+
1. Copy and paste the following commands into your command line to start the Docker containers using the configuration files you downloaded in the previous step. Note that you will need to replace the `<local-path>` in the commands with your local path.
79+
80+
```bash
81+
docker run --name loki -v <local-path>:/mnt/config -p 3100:3100 grafana/loki:3.0.0 --config.file=/mnt/config/loki-config.yaml
82+
docker run -v <local-path>:/mnt/config -v /var/log:/var/log --link loki grafana/promtail:3.0.0 --config.file=/mnt/config/promtail-config.yaml
83+
```
5384

54-
Navigate to http://localhost:3100/metrics to view the output.
85+
1. Verify that Loki is up and running.
86+
87+
- To view readiness, navigate to http://localhost:3100/ready.
88+
- To view metrics, navigate to http://localhost:3100/metrics.
5589

5690
## Install with Docker Compose
5791

5892
Run the following commands in your command line. They work for Windows or Linux systems.
5993

60-
```bash
61-
wget https://raw.githubusercontent.com/grafana/loki/v2.9.2/production/docker-compose.yaml -O docker-compose.yaml
62-
docker-compose -f docker-compose.yaml up
63-
```
94+
1. Create a directory called `loki`. Make `loki` your current working directory:
95+
96+
```bash
97+
mkdir loki
98+
cd loki
99+
```
100+
101+
1. Copy and paste the following command into your command line to download the `docker-compose` file.
102+
103+
```bash
104+
wget https://raw.githubusercontent.com/grafana/loki/v3.0.0/production/docker-compose.yaml -O docker-compose.yaml
105+
```
106+
107+
1. With `loki` as the current working directory, run the following 'docker-compose` command:
108+
109+
```bash
110+
docker-compose -f docker-compose.yaml up
111+
```
112+
113+
You should see something similar to the following:
114+
115+
```bash
116+
✔ Container mydevice-minio-1 Started 0.0s
117+
✔ Container mydevice-flog-1 Started 0.0s
118+
✔ Container mydevice-write-1 Started 0.0s
119+
✔ Container mydevice-read-1 Started 0.0s
120+
✔ Container mydevice-gateway-1 Started 0.0s
121+
✔ Container mydevice-grafana-1 Started 0.0s
122+
✔ Container mydevice-promtail-1 Started 0.0s
123+
```
124+
125+
1. Verify that Loki is up and running.
126+
127+
- To view readiness, navigate to http://localhost:3100/ready.
128+
- To view metrics, navigate to http://localhost:3100/metrics.

0 commit comments

Comments
 (0)