LoginSignup
8
6

More than 3 years have passed since last update.

Dockerで立ち上げたサービスのログをWeb上から簡単に見れる「Dozzle」

Last updated at Posted at 2020-03-07

ローカル開発環境でdockerを利用していると、docker logsなりdocker-compose logsコマンドでログを見ると思いますが確認するときにコマンド叩かなきゃいけなかったりで少し面倒ですよね。

調べてみたらいい感じにシンプルにweb上でdockerのログが見れるアプリケーションがあったので共有です。

Dozzle https://dozzle.dev/

Dozzleはめちゃくちゃ簡単にdockerのリアルタイムログが確認できるアプリケーションです。

image.png

とりあえず使うだけなら

docker run --detach --volume=/var/run/docker.sock:/var/run/docker.sock -p 9999:8080 amir20/dozzle

これだけ打つだけでdockerのログを確認することができるweb uiがhttp://localhost:9999に立ち上がります。

docker-compose.ymlに埋め込むなら

正直私はこっちがメイン

dozzle:
  image: amir20/dozzle:latest
  environment: 
    - DOZZLE_TAILSIZE=100
    - DOZZLE_FILTER=status=running
  volumes:
    - /var/run/docker.sock:/var/run/docker.sock
  ports:
    - "9999:8080"

こんな感じに。

https://github.com/amir20/dozzle#environment-variables-and-configuration
に設定できるEnvironmentが書かれています。

さいごに

正直毎回毎回コマンド経由でログを見るのは忘れたりとかしやすいのもあるので、こんな風にシンプルなアプリケーションがあるのは嬉しい。

8
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
6