I am trying to make calls to EOS nodeos server inside a docker container from the host machine.

Although the port 7777 is exposed:

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
e447cb3d2db5        eosio/eos           "/bin/bash"              3 days ago          Up 3 days >7777/tcp   server

When making the curl request, I get a 400 Bad Request error.

$ curl -vv -X POST
*   Trying
* Connected to ( port 7777 (#0)
> POST /v1/chain/get_info HTTP/1.1
> Host:
> User-Agent: curl/7.47.0
> Accept: */*
< HTTP/1.1 400 Bad Request

the docker network is:

$ docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
d3d275c83226        bridge              bridge              local
9f6a5439c22c        eosnetwork          bridge              local
db156b84ea13        host                host                local
83e9116a4419        none                null                local

Any idea why it is happening and how to fix it?


curl to the ip of the container works:

$ curl  -X POST

but I need it to work on from Anyway to achieve that?


After two days of trials and errors, I finally made it work.

To access the nodeos from another machine we need to do two things:

  1. start the docker where the nodeos is running with "docker run --net=host" option
  2. start the nodeos with "--http-validate-host=false" option

I hope it helps someone in the future!


This is the tutorial for the docker image: https://developers.eos.io/eosio-nodeos/docs/docker-quickstart

According to the docker documentation (https://docs.docker.com/config/containers/container-networking/), you need to add published port flag like -p 8888:8888 to your docker command. This will map the TCP port 8888 of the container to the TCP port 8888 of the Docker host.

--http-validate-host=false is needed as well in your nodeos config.ini.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.