Docker command (cli) defaulting to port instead of

2019-09-13 10:08发布

问题:

I've changed the docker daemon to listen on port eg: /usr/bin/docker daemon -H tcp://0.0.0.0:2375 Now when I execute the command docker it hangs on. So what I need is to execute docker -H :2375 <command>.

Is there any way how to setup docker command (cli) to automatically use the port not the socket (so when I call docker ps it will call docker -H :2375 ps)?

Thanks

回答1:

You can set the following in your environment (see the cli documentation for more options):

export DOCKER_HOST=127.0.0.1:2375


标签: docker