如何获取节点容器的日志?

如何获取节点容器的日志?
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-09-15T14_03_26_179Z-debug.log
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

我试过:

root@admin-vbox:/media/projects/admin# docker-compose exec node bash 
Error response from daemon: Container 1db9578fbcd06f68a66bd05e2f4f9dd346f889d2e33607be993760fbc9246df6 is restarting, wait until the container is running
root@yanik-vbox:/media/projects/admin# 

所以我无法进入容器,因为它不断重新启动。有没有办法检查日志里面的内容?

我也尝试过:

docker logs admin_node1

但它只给我上面的日志,没有所有的细节。

相关内容