From 057752d7bc86f43cdc1fe4a14a054066617a7149 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 14 Feb 2024 07:06:40 -0300 Subject: [PATCH] merge layers into Wazuh manager Dockerfile --- build-docker-images/wazuh-manager/Dockerfile | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/build-docker-images/wazuh-manager/Dockerfile b/build-docker-images/wazuh-manager/Dockerfile index e9f22a0b..9fcefd5d 100644 --- a/build-docker-images/wazuh-manager/Dockerfile +++ b/build-docker-images/wazuh-manager/Dockerfile @@ -9,26 +9,31 @@ ARG FILEBEAT_TEMPLATE_BRANCH ARG FILEBEAT_CHANNEL=filebeat-oss ARG FILEBEAT_VERSION=7.10.2 ARG WAZUH_FILEBEAT_MODULE +ARG S6_VERSION="v2.2.0.3" -RUN apt-get update && apt install curl apt-transport-https lsb-release xz-utils gnupg -y +RUN apt-get update && apt install curl apt-transport-https lsb-release xz-utils gnupg -y &&\ + apt autoremove && apt clean COPY config/check_repository.sh / +COPY config/filebeat_module.sh / +COPY config/permanent_data.env config/permanent_data.sh / + RUN chmod 775 /check_repository.sh RUN source /check_repository.sh RUN apt-get update && \ - apt-get install wazuh-manager=${WAZUH_VERSION}-${WAZUH_TAG_REVISION} - -COPY config/filebeat_module.sh / -RUN chmod 775 /filebeat_module.sh -RUN source /filebeat_module.sh - -ARG S6_VERSION="v2.2.0.3" -RUN curl --fail --silent -L https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-amd64.tar.gz \ + apt-get install wazuh-manager=${WAZUH_VERSION}-${WAZUH_TAG_REVISION} && \ + apt autoremove && apt clean && \ + chmod 775 /filebeat_module.sh && \ + source /filebeat_module.sh && \ + curl --fail --silent -L https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-amd64.tar.gz \ -o /tmp/s6-overlay-amd64.tar.gz && \ tar xzf /tmp/s6-overlay-amd64.tar.gz -C / --exclude="./bin" && \ tar xzf /tmp/s6-overlay-amd64.tar.gz -C /usr ./bin && \ - rm /tmp/s6-overlay-amd64.tar.gz + rm /tmp/s6-overlay-amd64.tar.gz && \ + chmod 755 /permanent_data.sh && \ + sync && /permanent_data.sh && \ + sync && rm /permanent_data.sh COPY config/etc/ /etc/ COPY --chown=root:wazuh config/create_user.py /var/ossec/framework/scripts/create_user.py @@ -43,11 +48,6 @@ RUN chmod go-w /etc/filebeat/wazuh-template.json # Prepare permanent data # Sync calls are due to https://github.com/docker/docker/issues/9547 -COPY config/permanent_data.env config/permanent_data.sh / -RUN chmod 755 /permanent_data.sh && \ - sync && /permanent_data.sh && \ - sync && rm /permanent_data.sh - #Make mount directories for keep permissions RUN mkdir -p /var/ossec/var/multigroups && \