From bf4c373d7b19dbad629d9a95f4086dcf66340c51 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 22 Aug 2016 16:22:36 -0700 Subject: [PATCH] Add an example Dockerfile to logstash --- logstash/content.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/logstash/content.md b/logstash/content.md index 401d49387..d12e9b2e0 100644 --- a/logstash/content.md +++ b/logstash/content.md @@ -23,3 +23,21 @@ If you need to run logstash with a configuration file, `logstash.conf`, that's l ```console $ docker run -it --rm -v "$PWD":/config-dir logstash -f /config-dir/logstash.conf ``` + +### Using a `Dockerfile` + +If you'd like to have a production Logstash image with a pre-baked configuration file, use of a `Dockerfile` is recommended: + +```dockerfile +FROM logstash + +COPY logstash.conf /some/config-dir/ + +CMD ["-f", "/some/config-dir/logstash.conf"] +``` + +Then, build with `docker build -t my-logstash .` and deploy with something like the following: + +```console +$ docker run -it --rm my-logstash +```