List all docker services without using swarm.

huangapple go评论52阅读模式
英文:

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 中的 networksservices

答案:所需的命令是 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

huangapple
  • 本文由 发表于 2023年3月9日 20:10:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/75684426.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定