1

I was as told that podman mimics docker. I am trying to ship some logs via promtail to grafana loki. When I run podman, the config is not getting picked up like I expect.

The documentation for getting started with podman was helpful, https://podman.io/getting-started/

But I failed to located documentation for using podman specifically with promtail.

This is what I tried successfully, via docker:

docker run -d --name promtail -v $(pwd):/mnt/config -v $(pwd)/log:/var/log grafana/promtail:2.7.4 -config.file=/mnt/config/promtail-config.yaml

Running it via podman failed.

podman run -d --name promtail -v $(pwd):/mnt/config -v $(pwd)/log:/var/log  docker.io/grafana/promtail -config.file=/mnt/config/promtail-config.yaml

I expected to be able to run the same command with podman as I did with docker.

BMitch
  • 231,797
  • 42
  • 475
  • 450

1 Answers1

1

I noticed that the podman command was ignoring my config.file flag, and instead was using a default config file.

The grafana/promtail image layers specify where the default promtail config file is located:

CMD ["-config.file=/etc/promtail/config.yml"]

After mounting my promtail-config.yaml file from my host machine to that location in the docker.io/grafana/promtail container and running podamn..

podman run -d --name promtail -v $(pwd)/promtail-config.yaml:/etc/promtail/config.yml -v $(pwd)/log:/var/log  docker.io/grafana/promtail

I am able to validate through the logs that my config file is being used and my logs are being shipped.

podman logs promtail