ablog

不器用で落着きのない技術者のメモ

macOS で Docker のログを見る

$ docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
# cd /var/lib/docker/containers/
/var/lib/docker/containers # ls -l
total 8
drwx------    4 root     root          4096 Jun 28 16:48 3449e97b9cc9c4b7afed594d23392e0261ca63cf803eed411a5a20f9041e89bb
drwx------    4 root     root          4096 Jun 28 16:52 ca94cae5e0cc8511584ba4965b3a08396fc769ac4d9556b7ef8279486b597901
# cd ca94cae5e0cc8511584ba4965b3a08396fc769ac4d9556b7ef8279486b597901
# ls -l
total 1668
-rw-r-----    1 root     root       1671811 Jun 28 17:02 ca94cae5e0cc8511584ba4965b3a08396fc769ac4d9556b7ef8279486b597901-json.log
drwx------    2 root     root          4096 Jun 28 16:52 checkpoints
-rw-------    1 root     root          2572 Jun 28 16:52 config.v2.json
-rw-r--r--    1 root     root          1258 Jun 28 16:52 hostconfig.json
-rw-r--r--    1 root     root            13 Jun 28 16:52 hostname
-rw-r--r--    1 root     root           174 Jun 28 16:52 hosts
drwx------    2 root     root          4096 Jun 28 16:52 mounts
-rw-r--r--    1 root     root            68 Jun 28 16:52 resolv.conf
-rw-r--r--    1 root     root            71 Jun 28 16:52 resolv.conf.hash
# less ca94cae5e0cc8511584ba4965b3a08396fc769ac4d9556b7ef8279486b597901-json.log
{"log":"\u001b[K{\"log\":\"Caused by: java.io.FileNotFoundException: Log directory specified does not exist: spark-ui-log-az11/eventlog\\r\\n\",\"stream\":\"stdout\",\"
time\":\"2020-06-28T16:48:51.\r\n","stream":"stdout","time":"2020-06-28T16:55:07.7423937Z"}
{"log":"\u001b[K537133028Z\"}\r\n","stream":"stdout","time":"2020-06-28T16:55:07.742415084Z"}
{"log":"\u001b[K{\"log\":\"\\u0009at org.apache.spark.deploy.history.FsHistoryProvider.org$apache$spark$deploy$history$FsHistoryProvider$$startPolling(FsHistoryProvider
.scala:267)\\r\\n\",\"st\r\n","stream":"stdout","time":"2020-06-28T16:55:07.742422149Z"}
{"log":"\u001b[Kream\":\"stdout\",\"time\":\"2020-06-28T16:48:51.53736452Z\"}\r\n","stream":"stdout","time":"2020-06-28T16:55:07.742428684Z"}
{"log":"\u001b[K{\"log\":\"\\u0009at org.apache.spark.deploy.history.FsHistoryProvider.initialize(FsHistoryProvider.scala:211)\\r\\n\",\"stream\":\"stdout\",\"time\":\"
2020-06-28T16:48:51.537374946Z\r\n","stream":"stdout","time":"2020-06-28T16:55:07.742434581Z"}
{"log":"\u001b[K\"}\r\n","stream":"stdout","time":"2020-06-28T16:55:07.742440539Z"}
{"log":"\u001b[K{\"log\":\"\\u0009at org.apache.spark.deploy.history.FsHistoryProvider.\\u003cinit\\u003e(FsHistoryProvider.scala:207)\\r\\n\",\"stream\":\"stdout\",\"t
ime\":\"2020-06-28T16:48:51.5377\r\n","stream":"stdout","time":"2020-06-28T16:55:07.742445306Z"}
{"log":"\u001b[K41419Z\"}\r\n","stream":"stdout","time":"2020-06-28T16:55:07.742451433Z"}
{"log":"\u001b[K{\"log\":\"\\u0009at org.apache.spark.deploy.history.FsHistoryProvider.\\u003cinit\\u003e(FsHistoryProvider.scala:86)\\r\\n\",\"stream\":\"stdout\",\"ti
me\":\"2020-06-28T16:48:51.53776\r\n","stream":"stdout","time":"2020-06-28T16:55:07.742458856Z"}
{"log":"\u001b[K9772Z\"}\r\n","stream":"stdout","time":"2020-06-28T16:55:07.74246571Z"}
{"log":"\u001b[K{\"log\":\"\\u0009... 6 more\\r\\n\",\"stream\":\"stdout\",\"time\":\"2020-06-28T16:48:51.538006567Z\"}\r\n","stream":"stdout","time":"2020-06-28T16:55:
07.74247089Z"}
{"log":"\u001b[K{\"log\":\"Caused by: java.io.FileNotFoundException: File spark-ui-log-az11/eventlog does not exist\\r\\n\",\"stream\":\"stdout\",\"time\":\"2020-06-28T
16:48:51.538259088Z\"}\r\n","stream":"stdout","time":"2020-06-28T16:55:07.742476435Z"}