diff --git a/docker/builder/Dockerfile b/docker/builder/Dockerfile index 048fabadce1d0..cbbf99c24e96e 100644 --- a/docker/builder/Dockerfile +++ b/docker/builder/Dockerfile @@ -65,22 +65,24 @@ ENV PATH=$GRADLE_HOME/bin/$PATH RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Create a non-root user and set up permissions -RUN useradd -ms /bin/bash indexer && mkdir -p /home/indexer/artifacts && chown -R indexer:indexer /home/indexer +#RUN useradd -ms /bin/bash -u 1000 wazuh-indexer && \ +# mkdir -p /home/wazuh-indexer/artifacts && \ +# chown -R 1000 /home/wazuh-indexer # Copy your build scripts into the container as root -ADD entrypoint.sh /home/indexer/ +ADD docker/builder/entrypoint.sh /home/wazuh-indexer/ # Change file permissions as root -RUN chmod +x /home/indexer/entrypoint.sh +RUN chmod +x /home/wazuh-indexer/entrypoint.sh # Create volume dir= -VOLUME /home/indexer/artifacts +#VOLUME /home/wazuh-indexer/artifacts # Switch to non-root user -USER indexer +USER wazuh-indexer # Set the working directory -WORKDIR /home/indexer +WORKDIR /home/wazuh-indexer # Entry point to the build script ENTRYPOINT ["./entrypoint.sh"] diff --git a/docker/builder/entrypoint.sh b/docker/builder/entrypoint.sh index a5ad583e74178..7a603b05961d7 100644 --- a/docker/builder/entrypoint.sh +++ b/docker/builder/entrypoint.sh @@ -17,7 +17,7 @@ clone_repositories() { echo "----------------------------------------" echo "Cloning Repositories" echo "----------------------------------------" - git clone --branch "$INDEXER_BRANCH" https://github.com/wazuh/wazuh-indexer --depth 1 ~/wazuh-indexer + #git clone --branch "$INDEXER_BRANCH" https://github.com/wazuh/wazuh-indexer --depth 1 ~/wazuh-indexer git clone --branch "$INDEXER_PLUGINS_BRANCH" https://github.com/wazuh/wazuh-indexer-plugins --depth 1 ~/wazuh-indexer-plugins git clone --branch "$INDEXER_REPORTING_BRANCH" https://github.com/wazuh/wazuh-indexer-reporting --depth 1 ~/wazuh-indexer-reporting }