build docker images from logstash repo (#10603)

introduces two rake tasks: `rake artifact:docker_oss` and `rake artifact:docker`, which will create the docker images of the OSS and non OSS packages. These tasks depend on the tar artifacts being built.

Also `rake artifact:all` has been modified to also call these two tasks.

most code was moved from https://github.com/elastic/logstash-docker/
This commit is contained in:
João Duarte 2019-04-04 11:27:06 +01:00 committed by GitHub
parent bb8d4fbc19
commit dc5db673ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 1088 additions and 2 deletions

25
docker/tests/conftest.py Normal file
View file

@ -0,0 +1,25 @@
from subprocess import run
import pytest
from .constants import container_name, version
import docker
docker_engine = docker.from_env()
def pytest_addoption(parser):
"""Customize testinfra with config options via cli args"""
# Let us specify which docker-compose-(image_flavor).yml file to use
parser.addoption('--image-flavor', action='store', default='full',
help='Docker image flavor; the suffix used in docker-compose-<flavor>.yml')
@pytest.fixture(scope='session', autouse=True)
def start_container():
image = 'docker.elastic.co/logstash/logstash-%s:%s' % (pytest.config.getoption('--image-flavor'), version)
docker_engine.containers.run(image, name=container_name, detach=True, stdin_open=False)
def pytest_unconfigure(config):
container = docker_engine.containers.get(container_name)
container.stop()
container.remove()