Docker-compose issue with elasticsearch and kibana docker image

I am trying to create a docker-compose file with the latest image version of Elasticsearch and Kibana. Even after mentioning the version name in docker-compose.yml, I am noticing that the image version is 7.11.1 for both Kibana and Elasticsearch.

Any idea why?

Thanks in advance :slight_smile:

{
  "name" : "es01",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "1sG7KH5KSyy5WM3qGw7F0g",
  "version" : {
    "number" : "7.11.1",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "ff17057114c2199c9c1bbecc727003a907c0db7a",
    "build_date" : "2021-02-15T13:44:09.394032Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Hi @toki0709 Welcome to the community!

You're going to need to show us your actual compose file or we're not going to be able to help. :slight_smile:

Also, please show the exact command you're running.

Also, are you sure that there isn't another elasticsearch already running? And your compose is never actually coming up?

Hi @stephenb, thanks for your comment. Here is my docker-compose file

version: '3.9'

services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.7.0
    container_name: elasticsearch
    ports:
      - '9200:9200'
    environment:
      discovery.type: single-node
      ES_JAVA_OPTS: -Xmx512m -Xms512m
      node.name: es01
      cluster.name: elasticsearch
    volumes:
      - ./elastic/data:/usr/share/elasticsearch/data
    networks:
      - elasticnet

  kibana:
    image: docker.elastic.co/kibana/kibana:8.7.0
    container_name: kibana
    ports:
      - '5601:5601'
    environment:
      SERVERNAME: kibana
      ELASTICSEARCH_HOSTS: http://elasticsearch:9200
      ES_JAVA_OPTS: -Xmx512m -Xms512m
    networks:
      - elasticnet
    depends_on:
      - elasticsearch
volumes:
  logvolume01: {}

networks:
  elasticnet: {}

I am using docker-compose up -d command. And there are no elasticsearch instance running.

Hi @toki0709

First that compose will not work for 8.X because of the auto security setup you will either need to following the example here or use the docker-compose file I shared at the bottom of this post.

You can use the sample and pare it down to a single node if you like.

Why yours is starting with the wrong version is often because the wrong compose file is being used.

SO typically you can use these types of commands to figure out what is going on.

What is the exact name of your compose file?

What's is the output of
docker images
docker ps

You can also be very explicit and name the compose file with

docker-compose -f ./compose.yml up

Here is an example of a docker compose without security enabled.
Warning this will have no security enabled do not put any sensitive data in it or make it available on the network.

There are some extra stuff in where resource limits etc which you can take out.

compose-8-x-no-security.yml

You can start it with
docker-compose -f compose-8-x-no-security.yml up

---
version: '3'
services:
  elasticsearch:
    container_name: es01
    image: docker.elastic.co/elasticsearch/elasticsearch:8.7.0
    # 8.x
    environment: ['CLI_JAVA_OPTS=-Xms2g -Xmx2g','bootstrap.memory_lock=true','discovery.type=single-node','xpack.security.enabled=false', 'xpack.security.enrollment.enabled=false']
    ports:
      - 9200:9200
    networks:
      - elastic
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    deploy:    
      resources:
          limits:
            cpus: '2.0'
          reservations:
            cpus: '1.0'
            
  kibana:
    image: docker.elastic.co/kibana/kibana:8.7.0
    container_name: kib01
    environment:
      XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: d1a66dfd-c4d3-4a0a-8290-2abcb83ab3aa
    ports:
      - 5601:5601
    networks:
      - elastic
    deploy:    
      resources:
          limits:
            cpus: '2.0'
          reservations:
            cpus: '1.0'

networks:
  elastic:

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