If your aim is only to work es in your dev machine you could use this:
miostackoverflow.yml
version: "3.7"
networks:
dev-net:
name: dev-net
driver: bridge
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.15.0 # this works perfectly fine
# platform: linux/amd64
# image: docker.elastic.co/elasticsearch/elasticsearch:7.15.0-amd64
container_name: elasticsearch
restart: unless-stopped
networks:
- dev-net
ports:
- "9200:9200"
- "9300:9300"
environment:
- discovery.type=single-node
# - bootstrap.system_call_filter=false # use to avoid the symptom eception. use it only on the amd64 version
kibana:
image: docker.elastic.co/kibana/kibana:7.15.0 # this works perfectly fine
# platform: linux/amd64
# image: docker.elastic.co/kibana/kibana:7.15.0-amd64
container_name: kibana
restart: unless-stopped
networks:
- dev-net
ports:
- "5601:5601"
depends_on:
- elasticsearch
When you use the active versions of the yaml file docker.elastic.co/elasticsearch/elasticsearch:7.15.0
and docker.elastic.co/kibana/kibana:7.15.0
without use the platform
container property, it start in less than one minute and you can access to kibana too.
docker compose -f miostackoverflow.yml up --build --remove-orphans
docker compose -f miostackoverflow.yml down -v --remove-orphans
NOTABENE
If you try to start the amd64 versions (i deactivated these on the yaml) you will get this exception on elastic:
elasticsearch | {"type": "server", "timestamp": "2022-12-15T11:22:13,750Z", "level": "WARN", "component": "o.e.b.JNANatives", "cluster.name": "docker-cluster", "node.name": "f25ebc3d7cbf", "message": "unable to install syscall filter: ",
elasticsearch | "stacktrace": ["java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed",
elasticsearch | "at org.elasticsearch.bootstrap.SystemCallFilter.linuxImpl(SystemCallFilter.java:331) ~[elasticsearch-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.bootstrap.SystemCallFilter.init(SystemCallFilter.java:606) ~[elasticsearch-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.bootstrap.JNANatives.tryInstallSystemCallFilter(JNANatives.java:248) [elasticsearch-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.bootstrap.Natives.tryInstallSystemCallFilter(Natives.java:102) [elasticsearch-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:108) [elasticsearch-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) [elasticsearch-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) [elasticsearch-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:167) [elasticsearch-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:158) [elasticsearch-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75) [elasticsearch-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:114) [elasticsearch-cli-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.cli.Command.main(Command.java:79) [elasticsearch-cli-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:123) [elasticsearch-7.15.0.jar:7.15.0]",
elasticsearch | "at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) [elasticsearch-7.15.0.jar:7.15.0]"] }
Anyway i set this in environment to avoid the above error
- bootstrap.system_call_filter=false
It's buggy, slow and you must wait 4 or 5 minutes to start.
However even in this case you should be able to access to elastic and kibana