updating image of elk using docker

Viewed 575

I am using docker-compose file for running elk service but i am running elk stack of version 7.5 and i want to update this to 7.8 without stopping services.I've tried docker-compose pull but it can't pull the latest image of elasticsearch logstash and kibana and i tried another way by manually pulling the latest image using docker pull command and then after i've updated the image name in docker-compose

docker-compose.yml

version: "3.3"
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.5.0
    container_name: elasticsearch
    environment:
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
    volumes:
      - elasticsearch:/usr/share/elasticsearch/data
    secrets:
      - source: elasticsearch.yml
        target: /usr/share/elasticsearch/config/elasticsearch.yml
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nproc: 20480
      nofile:
        soft: 160000
        hard: 160000
    logging:
      driver: "json-file"
      options:
        max-file: "9"
        max-size: "6m"
    restart: always
    ports:
      - 9200:9200
    networks:
      - esnet
  kibana:
    image: docker.elastic.co/kibana/kibana:7.5.0
    container_name: kibana
    depends_on:
      - elasticsearch
    restart: always
    logging:
      driver: "json-file"
      options:
        max-file: "9"
        max-size: "6m"
    secrets:
      - source: kibana.yml
        target: /usr/share/kibana/config/kibana.yml
    networks:
      - esnet
  logstash:
    image: docker.elastic.co/logstash/logstash:7.5.0
      container_name: logstash
    volumes:
      - ./logstash/pipeline:/usr/share/logstash/pipeline
      - ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml
      - ./logstash/config/jvm.options:/usr/share/logstash/config/jvm.options
      - ./logstash/plugins:/usr/share/logstash/plugins
    restart: always
    logging:
      driver: "json-file"
      options:
        max-file: "9"
        max-size: "6m"
    networks:
      - esnet

when docker-compose pull command doesn't work i tried this

docker pull docker.elastic.co/elasticsearch/elasticsearch:7.8.0
docker pull docker.elastic.co/kibana/kibana:7.8.0
docker pull docker.elastic.co/logstash/logstash:7.8.0

after that i made some changes to my docker-compose file i change image version so that docker-compose command does not take time to download the image so i already pull latest image

version: "3.3"
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0

and finally i used this command docker-compose restart

1 Answers

You can't do that. When you want to update the image, you have to run another container from the new image you want. Docker not support this feature. You can only update manually by the way change the name of the image and up again.

Related