connecting to services on docker host from docker container

Apologies for asking two unrelated questions.

  1. what is the best way of accessing the host machine of the docker container (i.e. I am trying to access a kafka instance running on the host, from my docker container so that I can publish some messages)

  2. Docker ERROR: Volume specifies nonexistent driver inmemory
  3. Cannot execute RUN mkdir in a Dockerfile
  4. docker daemon -H fd:// error out in shell
  5. Why not found, while it does exist?
  6. How to restart a single container with docker-compose
  7. Docker-compose config front-end with back-end's IP from host's perspective
  8. when I run docker run ..... on an image which I’ve modified that may have an issue/syntax error, it will naturally not start – is there a log file anywhere that I would be able to take a look at to debug the issue. (this question is somewhat related to the 1st question, since I did what was suggested on another post, but the image is still not starting)

  • YARN DCE can not running
  • How to connect to a dockerized PostgreSQL from (an undockerized) Python app
  • Permission issues with own built Docker container with Elasticsearch 2.1
  • Cannot download Docker images behind a proxy
  • Managed VM add to PATH
  • Trying to build a docker container, not found
  • 2 Solutions collect form web for “connecting to services on docker host from docker container”

    1. This is an ongoing discussion on what to use and what not, I don’t really know what is best. Using the docker run --net="host" is pretty easy but can be dangerous. See From inside of a Docker container, how do I connect to the localhost of the machine?.

    2. Use docker logs containerid or lookup the raw data in /var/lib/docker/containers/containerid/ for Ubuntu.

    1. You should have no problem connecting to the host using the local lan interface ip address. Suppose you have a host with ip

      docker run –rm -ti ubuntu bash

    should give you a response.

    1. You can use docker logs to see the standard output of your container.
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.