Home > Blockchain >  runtime: failed to create new OS thread (have 2 already; errno=22) in Docker: Elasticsearch
runtime: failed to create new OS thread (have 2 already; errno=22) in Docker: Elasticsearch

Time:12-02

I am pulling Elasticsearch image in my docker compose. It looks like this

 es:
    image: elasticsearch:5.6.4
    restart: "always"
    environment:
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    mem_limit: 1g
    ports:
      - "9200:9200"
      - "9300:9300"

I got this error:

ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries

I added platform: linux/amd64 to resolve this error but now when I run the docker-compose, I am getting the error below:

es_1         | runtime: failed to create new OS thread (have 2 already; errno=22)
es_1         | fatal error: newosproc
es_1         | 
es_1         | runtime stack:
es_1         | runtime.throw(0x4cb21f, 0x9)
es_1         |  /usr/local/go/src/runtime/panic.go:566  0x95
es_1         | runtime.newosproc(0xc420026000, 0xc420035fc0)
es_1         |  /usr/local/go/src/runtime/os_linux.go:160  0x194
es_1         | runtime.newm(0x4d6db8, 0x0)
es_1         |  /usr/local/go/src/runtime/proc.go:1572  0x132
es_1         | runtime.main.func1()
es_1         |  /usr/local/go/src/runtime/proc.go:126  0x36
es_1         | runtime.systemstack(0x53ae00)
es_1         |  /usr/local/go/src/runtime/asm_amd64.s:298  0x79
es_1         | runtime.mstart()
es_1         |  /usr/local/go/src/runtime/proc.go:1079
es_1         | 
es_1         | goroutine 1 [running]:
es_1         | runtime.systemstack_switch()
es_1         |  /usr/local/go/src/runtime/asm_amd64.s:252 fp=0xc420020768 sp=0xc420020760
es_1         | runtime.main()
es_1         |  /usr/local/go/src/runtime/proc.go:127  0x6c fp=0xc4200207c0 sp=0xc420020768
es_1         | runtime.goexit()

What I might be missing?

CodePudding user response:

The answer to sitick is essentially correct. If this is for local development I would just create a docker-compose.override.yml file and override the image with an appropriate one from here.

es:
  image: elasticsearch:7.14.2

(7.14.2 appears to fit your platform)

CodePudding user response:

You could try using another image made for your mac that should work better for arm64:

https://hub.docker.com/r/arm64v8/elasticsearch/

  • Related