I am having problems to create a cluster with Elasticsearch docker image .

I am deploying two different servers in my local network. There is no firewalls and the servers can communicate each others.

The command I am using is:

    docker run --name elasticsearch-container \
        -e cluster.name=docker-cluster \
        -e network.publish_host=192.168.1.161 \
        -e bootstrap.memory_lock=true \
        -e node.name=main01 --publish-all \
        -p 9200:9200 \
        -d docker.elastic.co/elasticsearch/elasticsearch:5.5.0

And on another server

    docker run --name elasticsearch-container \
        -e cluster.name=docker-cluster \
        -e network.publish_host=192.168.1.162 \
        -e bootstrap.memory_lock=true \
        -e discovery.zen.ping.unicast.hosts=192.168.1.161 \
        -e node.name=main02 --publish-all \
        -p 9200:9200 \
        -d docker.elastic.co/elasticsearch/elasticsearch:5.5.0

But the cluster does not work.

The message I am receiving is:

[o.e.c.s.ClusterService   ] [main02] new_master {main02}{Pq1uX-fAS2mPnw5IQ5fSyQ}{GIBd58CBSlaAMIkHaNrKtQ}{192.168.1.181}{192.168.1.181:9300}{ml.enabled=true}, reason: zen-disco-elected-as-master ([0] nodes joined)

I mapped a local config to the docker image and the config is :

    xpack.security.enabled: false
    cluster.name: "docker-cluster"
    network.host: 0.0.0.0
    discovery.zen.minimum_master_nodes: 1
    bootstrap.memory_lock: true

What I am doing wrong?

---
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB