问题

查看docker容器日志,使用了如下命令:

docker logs -f --tail 0b83f42a0efa

报错:

[root@localhost /]# docker logs -f --tail 0b83f42a0efa
"docker logs" requires exactly 1 argument.
See 'docker logs --help'.

Usage:  docker logs [OPTIONS] CONTAINER

Fetch the logs of a container

在这里插入图片描述


分析

"docker logs" requires exactly 1 argument.
"docker logs"需要一个参数

解决

给 --tail 加上参数:

docker logs -f --tail 100 0b83f42a0efa




参考:

【1】:““docker logs” requires exactly 1 argument. See ‘docker logs --help’. Usage: docker logs [OPTIONS] CONTAINER Fetch the logs of a container” Code Answer

【2】:Docker查看log命令与Linux查看log

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐