diff --git a/docker/ecs/images/Dockerfile b/docker/ecs/images/Dockerfile index 68374cb57ef1e..6249e8f706c97 100644 --- a/docker/ecs/images/Dockerfile +++ b/docker/ecs/images/Dockerfile @@ -4,9 +4,13 @@ RUN apt-get update && \ apt-get upgrade && \ apt-get install \ git && \ + apt-get clean \ && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ git clone https://github.com/elastic/ecs.git # Change this to a volume ADD docker/ecs/images/generate.sh ecs/generate.sh +ADD docker/ecs/images/entrypoint.sh entrypoint.sh ADD . wazuh-indexer/ + +ENTRYPOINT ["entrypoint.sh"] diff --git a/docker/ecs/images/entrypoint.sh b/docker/ecs/images/entrypoint.sh index e69de29bb2d1d..979930b2a6459 100644 --- a/docker/ecs/images/entrypoint.sh +++ b/docker/ecs/images/entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# SPDX-License-Identifier: Apache-2.0 +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +ECS_VERSION="${ECS_VERSION:-v8.11.0}" +INDEXER_SRC="${INDEXER_SRC:-/wazuh-indexer}" + +if [ -z "$ECS_DEFINITION" ]; then + echo "Error: ECS_DEFINITION environment variable missing." + exit 1 +fi + +bash ./generate.sh "$ECS_VERSION" "$INDEXER_SRC" "$ECS_DEFINITION"