# Logstash exits after successfully installing plugin with docker-compose

**URL:** <https://discuss.elastic.co/t/logstash-exits-after-successfully-installing-plugin-with-docker-compose/255456>\
**Category:** Logstash\
**Created:** [November 15, 2020, 11:18pm UTC](https://discuss.elastic.co/t/logstash-exits-after-successfully-installing-plugin-with-docker-compose/255456 "2020-11-15T23:18:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luka.klaric](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luka.klaric/32/71073_2.png) [@luka.klaric](https://discuss.elastic.co/u/luka.klaric)\
**Post date:** [November 15, 2020, 11:18pm UTC](https://discuss.elastic.co/t/logstash-exits-after-successfully-installing-plugin-with-docker-compose/255456/1 "2020-11-15T23:18:27Z")

</div>

I am trying to run an Elastic stack and I am trying to install a logstash plugin within the docker file. I am getting the message that the plugin is installed successful and right after that the container exits with code 0.

```auto
log01 | Validating logstash-codec-gzip_lines
log01 | Installing logstash-codec-gzip_lines
log01 | Installation successful
log01 exited with code 0

```

I tried it to install with the Docerfile and with the docker-compose.yml file, but in both ways I am getting the same "error".

Dockerfile

```auto
FROM docker.elastic.co/logstash/logstash:7.9.3

# Add your logstash plugins setup here
# Example: RUN logstash-plugin install logstash-filter-json
RUN bin/logstash-plugin install logstash-codec-gzip_lines

```

docker-compose.yml

```auto
...
logstash:
    build:
      context: logstash/
    #image: docker.elastic.co/logstash/logstash:7.9.3
    container_name: log01
    command: 'logstash-plugin install logstash-codec-gzip_lines'
    volumes:
      - type: bind
        source: ./logstash/config/logstash.yml
        target: /usr/share/logstash/config/logstash.yml
        read_only: true
      - type: bind
        source: ./logstash/pipeline
        target: /usr/share/logstash/pipeline
        read_only: true
      - type: volume
        source: certs
        target: /usr/share/logstash/config/certs
    ports:
      - 5044:5044
      - 5000:5000
      - 9600:9600
    environment:
      ELASTIC_USERNAME: <USER>
      ELASTIC_PASSWORD: <PASS>
      ELASTICSEARCH_HOST_PORT: https://es01:9200
      #LS_JAVA_OPTS: "-Xmx256m -Xms256m"
      LS_JAVA_OPTS: "-Xmx1g -Xms1g"

    networks:
      - elastic
    depends_on:
      - es01
...

```

Can anybody tell me why it is exiting, and how can I fix it?

---

<div class="post-metadata">

**Author:** ![anderson.lima](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@anderson.lima](https://discuss.elastic.co/u/anderson.lima)\
**Post date:** [November 25, 2020, 1:34pm UTC](https://discuss.elastic.co/t/logstash-exits-after-successfully-installing-plugin-with-docker-compose/255456/2 "2020-11-25T13:34:20Z")

</div>

Hi,

Did you manage to solve?

I have the same problem.

---

<div class="post-metadata">

**Author:** ![luka.klaric](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luka.klaric/32/71073_2.png) [@luka.klaric](https://discuss.elastic.co/u/luka.klaric)\
**Post date:** [December 1, 2020, 9:50pm UTC](https://discuss.elastic.co/t/logstash-exits-after-successfully-installing-plugin-with-docker-compose/255456/3 "2020-12-01T21:50:42Z")

</div>

at the and, an "--build" helped me. and of course, a deleted the "command" line from the docker-compose.yml

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 29, 2020, 9:50pm UTC](https://discuss.elastic.co/t/logstash-exits-after-successfully-installing-plugin-with-docker-compose/255456/4 "2020-12-29T21:50:48Z")

</div>

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