78
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Dockerのログが大きくなりすぎたから最新のだけ見たい

Last updated at Posted at 2018-07-30

立ち上げっぱなしのDockerだとログがずっと累積していくため、

$ docker logs -f <container-name>

上記コマンドで出力したとき最新のログにたどり着くまでに数分かかってしまうことが・・・。サクッと見たい・・・。
ログの削除で調べたが、うまく削除できずに困っていたところ、以下の情報を発見

image.png

つまり

$ docker logs -f --tail=500 <container-name>

--tail=500をつけることでサクッと見ることができる

参考:https://github.com/moby/moby/issues/24998#issuecomment-234941293

78
39
1

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
78
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?