Error: fleet-server failed: context canceled | Error - dial tcp 172.18.0.2:9200: i/o timeout

Hi Stuart!
Thanks for getting into my issue.
I followed these command from the documentation:

for Elastic:

docker network create elastic
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.2.2
docker run --name es01 --net elastic -p 9200:9200 -p 9300:9300 -it docker.elastic.co/elasticsearch/elasticsearch:8.2.2

and for Kibana:

docker pull docker.elastic.co/kibana/kibana:8.2.2
docker run --name kibana --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:8.2.2

So after that I have:

C:\Users\ilia1> docker ps -a
CONTAINER ID   IMAGE                                                 COMMAND                  CREATED        STATUS                      PORTS                                            NAMES
05833b8e71f9   docker.elastic.co/kibana/kibana:8.2.2                 "/bin/tini -- /usr/l…"   5 days ago     Exited (255) 32 hours ago   0.0.0.0:5601->5601/tcp                           kib-01
def740eb5293   docker.elastic.co/elasticsearch/elasticsearch:8.2.2   "/bin/tini -- /usr/l…"   5 days ago     Exited (255) 32 hours ago   0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp   es-node01

Actually I'm using docker desktop app to start containers so I presume it should be just
something like this:

C:\Users\ilia1>docker container start kib-01
kib-01

C:\Users\ilia1>docker container start es-node01
es-node01

Also here are my docker network settings:

C:\Users\ilia1>docker network inspect elastic
[
    {
        "Name": "elastic",
        "Id": "324deb04bbcc55e4c76de46da399da2bda8a896ce767e6985212dac89459ceaa",
        "Created": "2022-06-02T10:48:56.0936205Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {},
        "Labels": {}
    }
]

Weird that after launching containers I'm able to
open https://localhost:9200/ from my browser:
image

I also presume that the solution for me would be something simple, but I don't know where to dig...

I clearly see that fleet agent can't connect to the fleet server in docker container on (172.18.0.2:9200) according to the error:

Error - dial tcp 172.18.0.2:9200: i/o timeout

So:

  1. Am I correct that the fleet server (added on elk in container through fleet integration) and a fleet agent are everything I need?

  2. Shouldn't I additionally install fleet server and somehow additionally configure it to my current setup, should I?

If not could you please let me know is there an article somewhere on elastic showing how to tweak the standard docker network I created, so that I can connect my local fleet-agent with an elk fleet-server on the docker container?

Highly appreciate any suggestions!