我使用Docker
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:20:16 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:23:58 2018
OS/Arch: linux/amd64
Experimental: false
Docker容器
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
821dcb7bb9cb prakhar1989/static-site "./wrapper.sh" 2 days ago Up 2 days 0.0.0.0:32773->80/tcp, 0.0.0.0:32772->443/tcp static-site
将日志写入
/ var / lib / docker / containers / 821dcb7bb9cb7587c4806bbbeb1357052a5d9fcb05a5aa3f09821e07fa402d40 /
通过“容器ID”名称文件夹。
每个主机只能容纳一个容器,而您想要在日志ELK中抽出(我在共享索引中传输日志)。
如何通过容器名称将Docker日志保存到文件夹中?