How can I know which docker host my CLI returned the information from?

Scenario: I have 2 docker daemons listening on separate unix socket and TCP socket.

Question: If I run a command, say docker service ls then how can I know which docker host my CLI returned the information from?

docker service ls must be run ON the swarm manager node… not the participants of the swarm.

@sdetweil Thank you for the reply, but what if I am remotely connecting to another swarm manager from a host which itself is a swarm manager(and listening on both unix:// and tcp:// socket). How to know which docker swarm manager the CLI is connecting to?

define remotely connecting…

is this a question a docker cli should answer. i would suggest, that this is a responsibility of your surrounding (bash) script? just read the DOCKER_HOST-environment before or after your command.

@think @sdetweil Thank you will do the suggested :slight_smile: