# Elasticsearch 5.0 on Docker does not run

**URL:** <https://discuss.elastic.co/t/elasticsearch-5-0-on-docker-does-not-run/66753>\
**Category:** Elasticsearch\
**Created:** [November 21, 2016, 4:24pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-on-docker-does-not-run/66753 "2016-11-21T16:24:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iliasse](https://avatars.discourse-cdn.com/v4/letter/i/22d042/32.png) [@iliasse](https://discuss.elastic.co/u/iliasse)\
**Post date:** [November 21, 2016, 4:24pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-on-docker-does-not-run/66753/1 "2016-11-21T16:24:01Z")

</div>

Hi,

I'm trying to upgrade elasticsearch from 2.3 to 5.0. I've elasticsearch In Docker container.  
I'm building my Dockerfile from the Docker Official Image , and when I run it I get this error :

```
ERROR: bootstrap checks failed
memory locking requested for elasticsearch process but memory is not locked
[2016-11-21T16:02:42,412][INFO][o.e.n.Node] [Node0] stopping ...
2016-11-21 16:02:42,414 pool-1-thread-1 ERROR Unable to unregister MBeans java.security.AccessControlException: access denied ("javax.management.MBeanServerPermission" "createMBeanServer")
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
        at java.security.AccessController.checkPermission(AccessController.java:884)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
        at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:465)
        at org.apache.logging.log4j.core.jmx.Server.unregisterLoggerContext(Server.java:246)
        at org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:300)
        at org.apache.logging.log4j.core.LoggerContext$1.run(LoggerContext.java:265)
        at org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry$RegisteredCancellable.run(DefaultShutdownCallbackRegistry.java:102)
        at org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry.run(DefaultShutdownCallbackRegistry.java:72)
        at java.lang.Thread.run(Thread.java:745)

Exception: java.security.AccessControlException thrown from the UncaughtExceptionHandler in thread "Thread-2"

```

I'm running my Docker like this :

`sudo docker run --privileged=true -d --name=es -p 9200:9200 -p 9300:9300 --net=host -v /data/ESdata/Node0/:/usr/share/elasticsearch/data -v /backupes/esrepo/:/usr/share/elasticsearch/backup -e ES_JAVA_OPTS='-Xms31g -Xmx31g' elasticsearch:V5`

My limits.conf has this :

```
* - nofile 65535
* - memlock unlimited
* - nproc 64000 

```

and my elasticsearch.yml has the line :

`bootstrap.memory_lock: true`

Do you have any clue why I'm getting this ?  
Thank you.

---

<div class="post-metadata">

**Author:** ![iliasse](https://avatars.discourse-cdn.com/v4/letter/i/22d042/32.png) [@iliasse](https://discuss.elastic.co/u/iliasse)\
**Post date:** [November 22, 2016, 10:34am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-on-docker-does-not-run/66753/2 "2016-11-22T10:34:30Z")

</div>

Here is the beginning of the log trace :

`sudo docker logs es`

```
[2016-11-22T09:32:59,412][WARN][o.e.b.JNANatives] Unable to lock JVM Memory: error=12, reason=Cannot allocate memory
[2016-11-22T09:32:59,414][WARN][o.e.b.JNANatives] This can result in part of the JVM being swapped out.
[2016-11-22T09:32:59,414][WARN][o.e.b.JNANatives] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536
[2016-11-22T09:32:59,414][WARN][o.e.b.JNANatives] These can be adjusted by modifying /etc/security/limits.conf, for example:
        # allow user 'esearchqalr' mlockall
        esearchqalr soft memlock unlimited
        esearchqalr hard memlock unlimited

```

I do not understand why I'm getting this error while my limits.conf contains the unlimited memlock... I tried overriding it inside my Dockerfile but it did not work...

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [November 22, 2016, 10:40am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-on-docker-does-not-run/66753/3 "2016-11-22T10:40:04Z")

</div>

Not a docker expert at all here - but maybe looking at

> **[elastic/elasticsearch-docker](https://github.com/elastic/elasticsearch-docker)**
>
> elasticsearch-docker - Official Elasticsearch Docker image

helps you?

Isabel

---

<div class="post-metadata">

**Author:** ![iliasse](https://avatars.discourse-cdn.com/v4/letter/i/22d042/32.png) [@iliasse](https://discuss.elastic.co/u/iliasse)\
**Post date:** [November 22, 2016, 10:57am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-on-docker-does-not-run/66753/4 "2016-11-22T10:57:39Z")

</div>

Thank you mainec for your answer but unfortunately no.  
I've found a "fix" by adding --ulimit memlock=-1:-1 to my run command. But I don't know id it's a viable option once in production (Not sure...)

---

<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:** [December 20, 2016, 10:57am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-on-docker-does-not-run/66753/5 "2016-12-20T10:57:50Z")

</div>

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