Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active February 3, 2026 20:23
Show Gist options
  • Select an option

  • Save dacr/8f03e710f78cdbaa1bc3a5f567c2aae5 to your computer and use it in GitHub Desktop.

Select an option

Save dacr/8f03e710f78cdbaa1bc3a5f567c2aae5 to your computer and use it in GitHub Desktop.
start an elasticsearch through docker / published by https://github.com/dacr/code-examples-manager #b1cb8f97-f6af-4ecf-8664-e20f0c5946a2/3afaedd4d1ff4c5cd9a065edba563ae0e9ddc617
## summary : start an elasticsearch through docker
## keywords : bash, elasticsearch, docker, code-examples-manager, cem
## publish : gist
## authors : David Crosson
## license : Apache License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
## id : b1cb8f97-f6af-4ecf-8664-e20f0c5946a2
## created-on : 2021-04-29T16:52:54Z
## managed-by : https://github.com/dacr/code-examples-manager
## execution : bash
DKFILE="/tmp/cem-docker-compose.yml"
echo '
version: "3"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.12.1
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
ulimits:
memlock:
soft: -1
hard: -1
ports:
- 9200:9200
networks:
- elastic
kibana:
image: docker.elastic.co/kibana/kibana:7.12.1
depends_on:
- elasticsearch
ports:
- 5601:5601
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
networks:
- elastic
networks:
elastic:
external:
name: docker_default
' > ${DKFILE}
docker-compose -f ${DKFILE} up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment