logstash/docker/README.md
Joao Duarte 71d7b7c1fb
rake task to generate dockerfile
* dont include docker tasks in artifact:all
* don't rebuild tar/zip if source hasn't changed
* allow SKIP_PREPARE to avoid tar creation if no modifications
* don't need a tarball to generate the dockerfile
* remove docker tests as they weren't working anymore

This commit adds a task to produce all necessary files to generate a docker image.

```
% RELEASE=1 rake artifact:dockerfile
....
Dockerfile created in /tmp/elastic/logstash/build/docker
% tree /tmp/elastic/logstash/build/docker
/tmp/elastic/logstash/build/docker
├── Dockerfile
├── bin
│   └── docker-entrypoint
├── config
│   ├── log4j2.properties
│   ├── logstash-full.yml
│   └── pipelines.yml
├── env2yaml
│   └── env2yaml
└── pipeline
    └── default.conf
% docker build --rm .
.....
Step 19/20 : LABEL org.label-schema.schema-version="1.0"   org.label-schema.vendor="Elastic"   org.label-schema.name="logstash"   org.label-schema.version="7.0.0"   org.label-schema.url="https://www.elastic.co/products/logstash"   org.label-schema.vcs-url="https://github.com/elastic/logstash" license="Elastic License"
 ---> Using cache
 ---> f622d7555220
Step 20/20 : ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
 ---> Using cache
 ---> b6feba7f4934
Successfully built b6feba7f4934
```

This task works only for releases (not snapshots).

This commit also adds a few tweaks to the artifacts building:

Using `SKIP_PREPARE=1` in `rake artifact:tar` or `rake artifact:tar_oss` will make a check to not rebuild the tarball if there are no code modifications.

These two changes are made since docker image build is new and we want to keep it out of artifact:all for a while. And if we're running these separately, we want to ensure the tarball built is used in the docker image (versus building a new one for each `rake artifact:tar` )

This means that, to generate all artifacts including docker images and dockerfile, it's necessary to run:

```
RELEASE=1 rake artifact:all
SKIP_PREPARE=1 RELEASE=1 rake artifact:docker
SKIP_PREPARE=1 RELEASE=1 rake artifact:docker_oss
RELEASE=1 rake artifact:dockerfile
```
2019-04-22 22:57:55 +01:00

914 B

Description

This repository contains the official Logstash Docker image from Elastic.

Documentation can be found on the Elastic website.

Supported Docker versions

The images have been tested on Docker version 18.09.2, build 6247962

Requirements

A full build requires:

  • Docker
  • GNU Make
  • Python 3.5 with Virtualenv
  • JRuby 9.1+

Running a build

To build an image check out the corresponding branch for the version and run the rake task Like this:

git checkout 7.0
rake artifact:docker
# and for the OSS package
rake artifact:docker_oss

This image is built on Centos 7.