英文:
List all docker services without using swarm
问题
如何列出在Docker中运行的所有服务的Docker命令(或方式)?
我已尝试过 docker service ps service
输出:守护进程的错误响应:此节点不是一个Swarm管理器。请使用“docker swarm init”或“docker swarm join”来将此节点连接到Swarm,然后重试。
我不在使用Docker Swarm,也不想使用。我在寻找类似于Docker中的 kubectl get services
的等效命令。
英文:
What is the docker command (or how) to list all the services running in docker?
I have tried docker service ps service
Output: Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.
I am not using docker swarm and don't want to. I am looking for an equivalent of kubectl get services
in docker.
答案1
得分: 1
引用评论中的 @josephjacobmorris 的话:
docker services are specific to docker swarm
这个问题是因为混淆了 Docker 中的 networks
和 services
。
答案:所需的命令是 docker network ls
。
英文:
Quoting @josephjacobmorris from the comments:
docker services are specific to docker swarm
This question is due to confusing networks
and services
in docker.
Answer: The required command is docker network ls
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论