# Developing a Logstash plugin within Docker

**URL:** <https://discuss.elastic.co/t/developing-a-logstash-plugin-within-docker/245093>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [August 15, 2020, 10:32am UTC](https://discuss.elastic.co/t/developing-a-logstash-plugin-within-docker/245093 "2020-08-15T10:32:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cknz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cknz/32/9640_2.png) [@cknz](https://discuss.elastic.co/u/cknz)\
**Post date:** [August 15, 2020, 10:32am UTC](https://discuss.elastic.co/t/developing-a-logstash-plugin-within-docker/245093/1 "2020-08-15T10:32:44Z")

</div>

Hi, I'm more of a Python and C developer than a Ruby a Java developer, but I have a need to make my first real logstash plugin for some work I'm doing with Elastic.

My development environment is Windows 10 Enterprise with Docker Desktop, so while I intend to do all my code editing in Visual Studio Code, I want to do all my building and testing inside Docker containers. I realise I could just fire up a Linux VM at have at it, but I want to practice some useful DevOps style of skills that would be useful to spread around the rest of my team.

What I intend to do is the following:

- fork logstash-filter-geoip
- make it more generic to handle any (custom-made) MMDB datafile (that's another story 🙂)
- build / test / run my plugin using the [logstash container image](https://www.docker.elastic.co/r/logstash/logstash:7.8.1)

What I'm need help with:

- can someone verify if this is feasible?
- or is there an image that someone has already made that is suitable for such development?
- or should I create my own container image for building my plugin?

If I need to create my own custom container image, then I would suspect it would look something like [https://github.com/elastic/logstash/blob/master/Dockerfile](https://github.com/elastic/logstash/blob/master/Dockerfile)....  
actually **no** , as it would seem that [https://github.com/elastic/logstash/blob/master/docker/templates/Dockerfile.j2](https://github.com/elastic/logstash/blob/master/docker/templates/Dockerfile.j2) is the real Dockerfile that is used.

Comparing with the logstash filter development documentation [https://www.elastic.co/guide/en/logstash/current/filter-new-plugin.html](https://www.elastic.co/guide/en/logstash/current/filter-new-plugin.html), I would need:

- rake (noting /usr/share/logstash/vendor/jruby/bin/ is not in the PATH)
- bundle command is not found, which is needed for running tests. I saw one in /usr/share/logstash/vendor/bundle/jruby/2.5.0/bin/, but it has a shebang that points to a non-installed version of Java 8

I see that [https://github.com/elastic/logstash#prerequisites](https://github.com/elastic/logstash#prerequisites) says that you should 'gem install rake' and 'gem install bundler', which I've done inside the container using the 'gem' from the vendored Jruby.

Ideally what I'm aiming for is a container image that will take a directory containing my logstash-filter-mmdb directory, build it and run tests, and emit the compiled plugin ready for running inside a logstash instance.

Cheers,  
Cameron

---

<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:** [September 12, 2020, 10:32am UTC](https://discuss.elastic.co/t/developing-a-logstash-plugin-within-docker/245093/2 "2020-09-12T10:32:44Z")

</div>

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