# Custom Elasticsearch image does not run properly on Docker

**URL:** <https://discuss.elastic.co/t/custom-elasticsearch-image-does-not-run-properly-on-docker/227860>\
**Category:** Elasticsearch\
**Created:** [April 14, 2020, 6:59am UTC](https://discuss.elastic.co/t/custom-elasticsearch-image-does-not-run-properly-on-docker/227860 "2020-04-14T06:59:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Quang\_D\_Tr\_n](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/quang_d_tr_n/32/54722_2.png) [@Quang\_D\_Tr\_n](https://discuss.elastic.co/u/Quang_D_Tr_n)\
**Post date:** [April 14, 2020, 6:59am UTC](https://discuss.elastic.co/t/custom-elasticsearch-image-does-not-run-properly-on-docker/227860/1 "2020-04-14T06:59:34Z")

</div>

I want to build a custom Elasticsearch image which using my own `elasticsearch.yml` file (which works fine if I install Elasticsearch and use it in windows). I follow instruction to create `Dockerfile`[here](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_c_customized_image).

This is the Dockerfile:

```auto
FROM elasticsearch:5.6.11
COPY --chown=elasticsearch:elasticsearch ./elasticsearch.yml /usr/share/elasticsearch/config/

```

I build the image and run it without any error. This is the log of the container after running:

```auto
[2020-04-13T16:18:52,677][INFO][o.e.n.Node] [] initializing ...
[2020-04-13T16:18:52,895][INFO][o.e.e.NodeEnvironment] [DCdtI8f] using [1] data paths, mounts 
[[/usr/share/elasticsearch/data (/dev/sda1)]], net usable_space [44.6gb], net total_space [58.4gb], spins? [possibly], types [ext4]
[2020-04-13T16:18:52,895][INFO][o.e.e.NodeEnvironment] [DCdtI8f] heap size [1.9gb], compressed ordinary object pointers [true]
[2020-04-13T16:18:52,897][INFO][o.e.n.Node] node name [DCdtI8f] derived from node ID 
[DCdtI8fZRJu1RpF5q-LW3A]; set [node.name] to override
[2020-04-13T16:18:52,897][INFO][o.e.n.Node] version[5.6.11], pid[1], build[bc3eef4/2018-08-16T15:25:17.293Z], OS[Linux/4.19.76-linuxkit/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_181/25.181-b13]
[2020-04-13T16:18:52,898][INFO][o.e.n.Node] JVM arguments [-Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/usr/share/elasticsearch]
 [2020-04-13T16:18:54,556][INFO][o.e.p.PluginsService] [DCdtI8f] loaded module [aggs-matrix-stats]
[2020-04-13T16:18:54,556][INFO][o.e.p.PluginsService] [DCdtI8f] loaded module [ingest-common]
[2020-04-13T16:18:54,556][INFO][o.e.p.PluginsService] [DCdtI8f] loaded module [lang-expression]
[2020-04-13T16:18:54,556][INFO][o.e.p.PluginsService] [DCdtI8f] loaded module [lang-groovy]
[2020-04-13T16:18:54,556][INFO][o.e.p.PluginsService] [DCdtI8f] loaded module [lang-mustache]
[2020-04-13T16:18:54,556][INFO][o.e.p.PluginsService] [DCdtI8f] loaded module [lang-painless]
 [2020-04-13T16:18:54,556][INFO][o.e.p.PluginsService] [DCdtI8f] loaded module [parent-join]
[2020-04-13T16:18:54,556][INFO][o.e.p.PluginsService] [DCdtI8f] loaded module [percolator]
[2020-04-13T16:18:54,557][INFO][o.e.p.PluginsService] [DCdtI8f] loaded module [reindex]
[2020-04-13T16:18:54,557][INFO][o.e.p.PluginsService] [DCdtI8f] loaded module [transport-netty3]
[2020-04-13T16:18:54,557][INFO][o.e.p.PluginsService] [DCdtI8f] loaded module [transport-netty4]
[2020-04-13T16:18:54,557][INFO][o.e.p.PluginsService] [DCdtI8f] no plugins loaded
[2020-04-13T16:18:57,031][INFO][o.e.d.DiscoveryModule] [DCdtI8f] using discovery type [zen]
[2020-04-13T16:18:57,774][INFO][o.e.n.Node] initialized
[2020-04-13T16:18:57,775][INFO][o.e.n.Node] [DCdtI8f] starting ...
[2020-04-13T16:18:58,013][INFO][o.e.t.TransportService] [DCdtI8f] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}
[2020-04-13T16:19:01,128][INFO][o.e.c.s.ClusterService] [DCdtI8f] new_master {DCdtI8f}{DCdtI8fZRJu1RpF5q-LW3A}{pI96gxraRiy1k1K3cQnj2Q}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)[,]
[2020-04-13T16:19:01,168][INFO][o.e.h.n.Netty4HttpServerTransport] [DCdtI8f] publish_address 
{127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
[2020-04-13T16:19:01,169][INFO][o.e.n.Node] [DCdtI8f] started
[2020-04-13T16:19:01,174][INFO][o.e.g.GatewayService] [DCdtI8f] recovered [0] indices into cluster_state

```

But accessing `localhost:9200` is showing `ERR_EMPTY_RESPONSE` .

There is a security warning after building though since I build from Windows: “building Docker image from Window against non-Windows Docker host”

But the file that I copy has the same privileges in the warning: [![enter image description here](https://sea2.discourse-cdn.com/elastic/images/transparent.png)](https://i.stack.imgur.com/n6q3W.png)

What could be the problem here?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 12, 2020, 6:59am UTC](https://discuss.elastic.co/t/custom-elasticsearch-image-does-not-run-properly-on-docker/227860/2 "2020-05-12T06:59:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
