Docker port bindings

docker ps command gives me:

PORTS
127.0.0.1:40000->8888/tcp 

Does it mean that port 40000 is busy and nobody can use given port?
I guess that is the case.

  • Docker exits immediately after run. However, Kitematic runs without issue
  • Save export images from one server to another
  • Use of docker tomcat with external WAR
  • Create a Docker container with MySQL/MariaDB database
  • Docker volume access from host
  • How can I access the Kubernetes service through ClusterIP
  • If so, why command lsof -i :40000 gives me an empty output?

  • Saving Docker container state on Windows
  • Performance of IBM Containers Volumes
  • How to use 'when' conditional with Systemd Unit configs
  • Does Docker EXPOSE make a new layer?
  • Docker service Limits and Reservations
  • How to export Mongo-database using Docker?
  • One Solution collect form web for “Docker port bindings”

    Yes, that does mean that port 40000 on 127.0.0.1 is being forwarded to a docker container. It does not necessarily mean that the container application is listening on port 8888 on all container interfaces (0.0.0.0) which is needed to complete that connection.

    Three reasons that I can think of where lsof -i :40000 would give no output:

    1. You didn’t run the lsof command as root
    2. Something has killed the docker-proxy process used to relay this traffic
    3. You ran the lsof command on a different machine than your docker host. Docker is a client/server app, and by setting $DOCKER_HOST you can connect to a remote machine to see the status of a remote host.
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.