Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions dockerfiles/docker-compose.yml

This file was deleted.

54 changes: 0 additions & 54 deletions dockerfiles/run.sh

This file was deleted.

1 change: 1 addition & 0 deletions release/docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gem
7 changes: 3 additions & 4 deletions dockerfiles/Dockerfile → release/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
# VERSION: Optional. Specify the label for image. Defaults to 7.13.2

ARG VERSION
ARG ARCH
FROM docker.elastic.co/logstash/logstash-oss:${VERSION}-${ARCH}
FROM docker.elastic.co/logstash/logstash-oss:${VERSION}
USER logstash
COPY --chown=logstash:logstash dockerfiles/bin/logstash-output-opensearch-*.gem /tmp/logstash-output-opensearch.gem
COPY --chown=logstash:logstash dockerfiles/logstash-opensearch-sample.conf /usr/share/logstash/config/
COPY --chown=logstash:logstash ./logstash-output-opensearch-*.gem /tmp/logstash-output-opensearch.gem
COPY --chown=logstash:logstash ./logstash-opensearch-sample.conf /usr/share/logstash/config/
RUN /usr/share/logstash/bin/logstash-plugin install /tmp/logstash-output-opensearch.gem
45 changes: 45 additions & 0 deletions release/docker/build-docker-multi-arch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

# This is intended to be run the plugin's root directory. `dockerfiles/run.sh`
# Ensure you have Docker and docker-compose installed locally
set -e

# Variables
BUILDER_NUM=`date +%s`
BUILDER_NAME="multiarch_${BUILDER_NUM}"

# Imports and functions
function cleanup_docker_buildx() {
# Cleanup docker buildx
echo -e "\n* Cleanup docker buildx"
docker buildx use default
docker buildx rm $BUILDER_NAME > /dev/null 2>&1
}

# Building plugin
bash build-plugin.sh

# Identify Logstash version
version=${LOGSTASH_VERSION}
if [[ -z "$version" ]]; then
version=7.13.2
fi

# Prepare docker buildx
trap cleanup_docker_buildx TERM INT EXIT
echo -e "\n* Prepare docker buildx"
docker buildx use default
docker buildx create --name $BUILDER_NAME --use
docker buildx inspect --bootstrap

# Check buildx status
echo -e "\n* Check buildx status"
docker buildx ls | grep $BUILDER_NAME
docker ps | grep $BUILDER_NAME

# Docker Build Images
docker buildx build --platform linux/amd64,linux/arm64 --build-arg VERSION=$version -t opensearchstaging/logstash-oss-with-opensearch-output-plugin:$version -f Dockerfile --push .

13 changes: 6 additions & 7 deletions dockerfiles/build.sh → release/docker/build-plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
# Ensure you have Docker installed locally and set the VERSION and BUILD_DATE environment variable.
set -e

if [ -d dockerfiles/bin ]; then
rm -rf dockerfiles/bin
fi
echo 'Clear previous gem'
echo -n "Remove "; rm -rfv logstash-output-opensearch*.gem

mkdir -p dockerfiles/bin
echo 'Copy gemspec'
trap '{ echo -n "Remove "; rm -rfv logstash-output-opensearch.gemspec; }' INT TERM EXIT
cp -v ../../logstash-output-opensearch.gemspec .

echo 'Building plugin'
echo 'Building plugin gem'
gem build logstash-output-opensearch.gemspec

echo "Moving gem to bin directory"
mv logstash-output-opensearch*.gem dockerfiles/bin/