From 65f46e157b63c49ffe384081f6325ab5000a7ffc Mon Sep 17 00:00:00 2001 From: Federico Gustavo Galland <99492720+f-galland@users.noreply.github.com> Date: Thu, 18 Jan 2024 09:14:50 -0300 Subject: [PATCH 1/4] Fix RPM package references to /var/run (#119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Switch /var/run references to /run * Remove unneeded files from assembled packages (#115) * add remove files function to assemble.sh * Remove unneeded files on assembled tar packages * Remove duplicated function Fix wrong variable assignment --------- Co-authored-by: Álex Ruiz * Add missing tools and files back into Wazuh Indexer packages (#117) * add remove files function to assemble.sh * Remove unneeded files on assembled tar packages * Remove duplicated function Fix wrong variable assignment * Adding function to package Wazuh`s tools to assemble.sh * Make the files' versions follow the repo's VERSION file * Fix download of Wazuh tools for packages assembly --------- Signed-off-by: Álex Ruiz Co-authored-by: Álex Ruiz * Remove unneeded symbolic links from assembled packages (#121) * Remove reference to install_demo_configuration.sh --------- Signed-off-by: Álex Ruiz Co-authored-by: Álex Ruiz --- distribution/packages/src/common/env/wazuh-indexer | 2 +- distribution/packages/src/common/scripts/postrm | 4 ++-- distribution/packages/src/common/systemd/wazuh-indexer.conf | 2 +- .../packages/src/common/systemd/wazuh-indexer.service | 2 +- distribution/packages/src/deb/debmake_install.sh | 2 +- distribution/packages/src/rpm/init.d/wazuh-indexer | 2 +- distribution/packages/src/rpm/wazuh-indexer.rpm.spec | 4 ---- 7 files changed, 7 insertions(+), 11 deletions(-) diff --git a/distribution/packages/src/common/env/wazuh-indexer b/distribution/packages/src/common/env/wazuh-indexer index 1b6f33db8a34b..553fefc3adba7 100644 --- a/distribution/packages/src/common/env/wazuh-indexer +++ b/distribution/packages/src/common/env/wazuh-indexer @@ -13,7 +13,7 @@ OPENSEARCH_PATH_CONF=${path.conf} # wazuh-indexer PID directory -#PID_DIR=/var/run/wazuh-indexer +#PID_DIR=/run/wazuh-indexer # Additional Java OPTS #OPENSEARCH_JAVA_OPTS= diff --git a/distribution/packages/src/common/scripts/postrm b/distribution/packages/src/common/scripts/postrm index 70871f9ae3004..ea5bf80944481 100644 --- a/distribution/packages/src/common/scripts/postrm +++ b/distribution/packages/src/common/scripts/postrm @@ -72,9 +72,9 @@ if [ "$REMOVE_DIRS" = "true" ]; then echo " OK" fi - if [ -d /var/run/wazuh-indexer ]; then + if [ -d /run/wazuh-indexer ]; then echo -n "Deleting PID directory..." - rm -rf /var/run/wazuh-indexer + rm -rf /run/wazuh-indexer echo " OK" fi diff --git a/distribution/packages/src/common/systemd/wazuh-indexer.conf b/distribution/packages/src/common/systemd/wazuh-indexer.conf index f9aa920e837b6..c021c7bcbb024 100644 --- a/distribution/packages/src/common/systemd/wazuh-indexer.conf +++ b/distribution/packages/src/common/systemd/wazuh-indexer.conf @@ -1 +1 @@ -d /var/run/wazuh-indexer 0750 wazuh-indexer wazuh-indexer - - +d /run/wazuh-indexer 0750 wazuh-indexer wazuh-indexer - - diff --git a/distribution/packages/src/common/systemd/wazuh-indexer.service b/distribution/packages/src/common/systemd/wazuh-indexer.service index e396257a9d5cf..130f22472d2e4 100644 --- a/distribution/packages/src/common/systemd/wazuh-indexer.service +++ b/distribution/packages/src/common/systemd/wazuh-indexer.service @@ -10,7 +10,7 @@ RuntimeDirectory=wazuh-indexer PrivateTmp=true Environment=OPENSEARCH_HOME=/usr/share/wazuh-indexer Environment=OPENSEARCH_PATH_CONF=${path.conf} -Environment=PID_DIR=/var/run/wazuh-indexer +Environment=PID_DIR=/run/wazuh-indexer Environment=OPENSEARCH_SD_NOTIFY=true EnvironmentFile=-${path.env} diff --git a/distribution/packages/src/deb/debmake_install.sh b/distribution/packages/src/deb/debmake_install.sh index 021a31e260d15..3e0f4141c87d0 100644 --- a/distribution/packages/src/deb/debmake_install.sh +++ b/distribution/packages/src/deb/debmake_install.sh @@ -21,7 +21,7 @@ product_dir=/usr/share/wazuh-indexer # config_dir=/etc/wazuh-indexer data_dir=/var/lib/wazuh-indexer log_dir=/var/log/wazuh-indexer -pid_dir=/var/run/wazuh-indexer +pid_dir=/run/wazuh-indexer buildroot=${curdir}/debian/wazuh-indexer # Create necessary directories diff --git a/distribution/packages/src/rpm/init.d/wazuh-indexer b/distribution/packages/src/rpm/init.d/wazuh-indexer index 75b7b7ac9756f..218519f204a64 100644 --- a/distribution/packages/src/rpm/init.d/wazuh-indexer +++ b/distribution/packages/src/rpm/init.d/wazuh-indexer @@ -39,7 +39,7 @@ MAX_OPEN_FILES=65535 MAX_MAP_COUNT=262144 OPENSEARCH_PATH_CONF="${path.conf}" -PID_DIR="/var/run/wazuh-indexer" +PID_DIR="/run/wazuh-indexer" # Source the default env file OPENSEARCH_ENV_FILE="${path.env}" diff --git a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec index 28be42bbb9fc4..ca1353142bee8 100644 --- a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec +++ b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec @@ -104,10 +104,6 @@ exit 0 %post set -e -# Apply Security Settings -if [ -d %{product_dir}/plugins/opensearch-security ]; then - sh %{product_dir}/plugins/opensearch-security/tools/install_demo_configuration.sh -y -i -s > %{log_dir}/install_demo_configuration.log 2>&1 -fi chown -R %{name}.%{name} %{config_dir} chown -R %{name}.%{name} %{log_dir} # Apply PerformanceAnalyzer Settings From 82f358adedb2474fb62fbf59982e7ec4b974ac54 Mon Sep 17 00:00:00 2001 From: Federico Gustavo Galland <99492720+f-galland@users.noreply.github.com> Date: Thu, 18 Jan 2024 09:39:37 -0300 Subject: [PATCH 2/4] Removing post-install message from wazuh-indexer.rpm.spec (#131) --- .../packages/src/rpm/wazuh-indexer.rpm.spec | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec index ca1353142bee8..9f89b01056993 100644 --- a/distribution/packages/src/rpm/wazuh-indexer.rpm.spec +++ b/distribution/packages/src/rpm/wazuh-indexer.rpm.spec @@ -132,19 +132,11 @@ if command -v systemd-tmpfiles > /dev/null; then fi # Messages -echo "### NOT starting on installation, please execute the following statements to configure opensearch service to start automatically using systemd" +echo "### NOT starting on installation, please execute the following statements to configure wazuh-indexer service to start automatically using systemd" echo " sudo systemctl daemon-reload" -echo " sudo systemctl enable opensearch.service" -echo "### You can start opensearch service by executing" -echo " sudo systemctl start opensearch.service" -if [ -d %{product_dir}/plugins/opensearch-security ]; then - echo "### Create opensearch demo certificates in %{config_dir}/" - echo " See demo certs creation log in %{log_dir}/install_demo_configuration.log" -fi -echo "### Upcoming breaking change in packaging" -echo " In a future release of OpenSearch, we plan to change the permissions associated with access to installed files" -echo " If you are configuring tools that require read access to the OpenSearch configuration files, we recommend you add the user that runs these tools to the 'opensearch' group" -echo " For more information, see https://github.com/opensearch-project/opensearch-build/pull/4043" +echo " sudo systemctl enable wazuh-indexer.service" +echo "### You can start wazuh-indexer service by executing" +echo " sudo systemctl start wazuh-indexer.service" exit 0 %preun From e73775e27f3b8b072eec602f477c63737ca155ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 18 Jan 2024 18:34:10 +0100 Subject: [PATCH 3/4] Add tests to the packages building process (#132) Runs the workflow on pull request changes --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d5a1d1e67f88..96e6826794abc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,10 @@ name: Build packages # This workflow runs when any of the following occur: # - Run manually on: + pull_request: + # Sequence of patterns matched against refs/heads + branches: + - 'ci/*' workflow_dispatch: inputs: revision: From 303e0b89fc30ccff9b4177f9dbd3055f725641a0 Mon Sep 17 00:00:00 2001 From: Federico Gustavo Galland <99492720+f-galland@users.noreply.github.com> Date: Fri, 19 Jan 2024 08:32:37 -0300 Subject: [PATCH 4/4] Get Wazuh version from VERSION file (#122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add function to look for VERSION in the correct path * Update assemble.sh Adds wget as dependency * Download files using curl instead of wget * Update assemble.sh Revert assembly with minimal plugins for testing Signed-off-by: Álex Ruiz * Add Dockerfile and docker-compose for the package assembly stage * Assemble packages with minimal plugin set when "test" variable is set to "true" * Update README with assemble.sh docker image * Fixing env variable naming convention and removing wget dependency * Improve Docker environments Adds environments to build packages * Fix small typos * More fixes * Add documentation * Adding -p flag to mkdir so it doesnt fail when the folder is already present * Format files --------- Signed-off-by: Álex Ruiz Co-authored-by: Álex Ruiz --- docker/README.md | 17 +++- docker/ci/ci.sh | 62 +++++++++++++ docker/ci/ci.yml | 29 ++++++ docker/{ => ci}/images/.dockerignore | 0 docker/ci/images/Dockerfile | 17 ++++ docker/dev.yml | 26 ------ docker/{ => dev}/dev.sh | 12 ++- docker/dev/dev.yml | 19 ++++ docker/dev/images/.dockerignore | 68 ++++++++++++++ .../images/Dockerfile} | 10 +- scripts/README.md | 51 +++-------- scripts/assemble.sh | 91 +++++++++++-------- scripts/provision.sh | 2 +- 13 files changed, 283 insertions(+), 121 deletions(-) create mode 100755 docker/ci/ci.sh create mode 100644 docker/ci/ci.yml rename docker/{ => ci}/images/.dockerignore (100%) create mode 100644 docker/ci/images/Dockerfile delete mode 100644 docker/dev.yml rename docker/{ => dev}/dev.sh (82%) create mode 100644 docker/dev/dev.yml create mode 100644 docker/dev/images/.dockerignore rename docker/{images/wi-dev.Dockerfile => dev/images/Dockerfile} (67%) diff --git a/docker/README.md b/docker/README.md index 4b41a42e0e9c9..e012e8c42bed1 100644 --- a/docker/README.md +++ b/docker/README.md @@ -51,19 +51,28 @@ Docker Desktop will change to its context automatically at start, so be sure that any existing Docker container using the default context is **stopped** before starting Docker Desktop and any of the environments in this folder. -## Starting up the environments +## Development environments -Use the sh script to up the environment. +Use the `dev/dev.sh` script to start a development environment. Example: ```bash -Usage: ./dev.sh {up|down|stop} [security] +Usage: ./dev.sh {up|down|stop} ``` -Once the `wazuh-indexer` container is up, attach a shell to it and run `./gradlew run` +Once the `wi-dev:x.y.z` container is up, attach a shell to it and run `./gradlew run` to start the application. +## Containers to generate packages + +Use the `ci/ci.sh` script to start provisioned containers to generate packages. + +```bash +Usage: ./ci.sh {up|down|stop} [ci] +``` + +Refer to [scripts/README.md](../scripts/README.md) for details about how to build packages. [docker-desktop]: https://docs.docker.com/get-docker [docker-variant]: https://docs.docker.com/desktop/install/linux-install/#differences-between-docker-desktop-for-linux-and-docker-engine diff --git a/docker/ci/ci.sh b/docker/ci/ci.sh new file mode 100755 index 0000000000000..13e84c0881b3f --- /dev/null +++ b/docker/ci/ci.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# Start container with required tools to build packages +# Requires Docker +# Script usage: bash ./ci.sh + +set -e + +# ==== +# Checks that the script is run from the intended location +# ==== +function check_project_root_folder() { + current=$(basename "$(pwd)") + + if [[ "$0" != "./ci.sh" && "$0" != "ci.sh" ]]; then + echo "Run the script from its location" + usage + exit 1 + fi + # Change working directory to the root of the repository + cd ../.. +} + +# ==== +# Displays usage +# ==== +function usage() { + echo "Usage: ./ci.sh {up|down|stop}" +} + +# ==== +# Main function +# ==== +function main() { + check_project_root_folder "$@" + compose_file="docker/${current}/ci.yml" + compose_cmd="docker compose -f $compose_file" + REPO_PATH=$(pwd) + VERSION=$(cat VERSION) + export REPO_PATH + export VERSION + + case $1 in + up) + # Main folder created here to grant access to both containers + mkdir -p artifacts + $compose_cmd up -d + ;; + down) + $compose_cmd down + ;; + stop) + $compose_cmd stop + ;; + *) + usage + exit 1 + ;; + esac +} + +main "$@" diff --git a/docker/ci/ci.yml b/docker/ci/ci.yml new file mode 100644 index 0000000000000..a18ca915302f0 --- /dev/null +++ b/docker/ci/ci.yml @@ -0,0 +1,29 @@ +version: "3.9" + +services: + # Essentially wi-dev, but doesn't expose port 9200 + wi-build: + image: wi-build:${VERSION} + container_name: wi-build_${VERSION} + build: + context: ./../.. + dockerfile: ${REPO_PATH}/docker/dev/images/Dockerfile + volumes: + - ${REPO_PATH}:/home/wazuh-indexer + entrypoint: ["tail", "-f", "/dev/null"] + user: "1000:1000" + working_dir: /home/wazuh-indexer + + wi-assemble: + image: wi-assemble:${VERSION} + container_name: wi-assemble_${VERSION} + build: + context: ./../.. + dockerfile: ${REPO_PATH}/docker/ci/images/Dockerfile + volumes: + - ${REPO_PATH}/scripts:/home/wazuh-indexer/scripts + - ${REPO_PATH}/artifacts:/home/wazuh-indexer/artifacts + - ${REPO_PATH}/distribution/packages/src:/home/wazuh-indexer/distribution/packages/src + entrypoint: ["tail", "-f", "/dev/null"] + user: "1000:1000" + working_dir: /home/wazuh-indexer diff --git a/docker/images/.dockerignore b/docker/ci/images/.dockerignore similarity index 100% rename from docker/images/.dockerignore rename to docker/ci/images/.dockerignore diff --git a/docker/ci/images/Dockerfile b/docker/ci/images/Dockerfile new file mode 100644 index 0000000000000..c84791adcb3e5 --- /dev/null +++ b/docker/ci/images/Dockerfile @@ -0,0 +1,17 @@ +FROM ubuntu:jammy +RUN mkdir /home/wazuh-indexer && \ + apt-get update -y && \ + apt-get install curl gnupg2 -y && \ + curl -o- https://www.aptly.info/pubkey.txt | apt-key add - && \ + echo "deb http://repo.aptly.info/ squeeze main" | tee -a /etc/apt/sources.list.d/aptly.list && \ + apt-get update -y && \ + apt-get upgrade -y && \ + apt-get install -y aptly build-essential cpio debhelper-compat debmake freeglut3 libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-dev libcairo2 libcairo2-dev libcups2 libdrm2 libgbm-dev libgconf-2-4 libnspr4 libnspr4-dev libnss3 libpangocairo-1.0-0 libxcomposite-dev libxdamage1 libxfixes-dev libxfixes3 libxi6 libxkbcommon-x11-0 libxrandr2 libxrender1 libxtst6 rpm rpm2cpio && \ + apt-get clean -y && \ + dpkg -r lintian && \ + addgroup --gid 1000 wazuh-indexer && \ + adduser --uid 1000 --ingroup wazuh-indexer --disabled-password --home /home/wazuh-indexer wazuh-indexer && \ + chmod 0775 /home/wazuh-indexer && \ + chown -R 1000:1000 /home/wazuh-indexer +USER wazuh-indexer +WORKDIR /home/wazuh-indexer diff --git a/docker/dev.yml b/docker/dev.yml deleted file mode 100644 index 7e3b6202c2ee9..0000000000000 --- a/docker/dev.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: "3.9" - -services: - - wazuh-indexer: - image: wazuh-indexer-dev:${VERSION} - container_name: wazuh-indexer-dev-${VERSION} - build: - context: ./.. - dockerfile: ${REPO_PATH}/docker/images/wi-dev.Dockerfile - ports: - # OpenSearch REST API - - 9200:9200 - # Cross-cluster search - # - 9250:9250 - # Node communication and transport - # - 9300:9300 - # Performance Analyzer - # - 9600:9600 - expose: - - 9200 - volumes: - - ${REPO_PATH}:/home/wazuh-indexer/app - entrypoint: ['tail', '-f', '/dev/null'] - user: "1000:1000" - working_dir: /home/wazuh-indexer/app diff --git a/docker/dev.sh b/docker/dev/dev.sh similarity index 82% rename from docker/dev.sh rename to docker/dev/dev.sh index 991ed42de29e7..f20b7359c9206 100755 --- a/docker/dev.sh +++ b/docker/dev/dev.sh @@ -9,14 +9,16 @@ set -e # ==== # Checks that the script is run from the intended location # ==== -function check_project_root_folder () { +function check_project_root_folder() { + current=$(basename "$(pwd)") + if [[ "$0" != "./dev.sh" && "$0" != "dev.sh" ]]; then - echo "Run the script from its location" + echo "Run the script from its location" usage exit 1 fi # Change working directory to the root of the repository - cd .. + cd ../.. } # ==== @@ -31,7 +33,7 @@ function usage() { # ==== function main() { check_project_root_folder "$@" - compose_file=docker/dev.yml + compose_file="docker/${current}/dev.yml" compose_cmd="docker compose -f $compose_file" REPO_PATH=$(pwd) VERSION=$(cat VERSION) @@ -55,4 +57,4 @@ function main() { esac } -main "$@" \ No newline at end of file +main "$@" diff --git a/docker/dev/dev.yml b/docker/dev/dev.yml new file mode 100644 index 0000000000000..7176b044df5ba --- /dev/null +++ b/docker/dev/dev.yml @@ -0,0 +1,19 @@ +version: "3.9" + +services: + wi-dev: + image: wi-dev:${VERSION} + container_name: wi-dev_${VERSION} + build: + context: ./../.. + dockerfile: ${REPO_PATH}/docker/dev/images/Dockerfile + ports: + # OpenSearch REST API + - 9200:9200 + expose: + - 9200 + volumes: + - ${REPO_PATH}:/home/wazuh-indexer + entrypoint: ["tail", "-f", "/dev/null"] + user: "1000:1000" + working_dir: /home/wazuh-indexer diff --git a/docker/dev/images/.dockerignore b/docker/dev/images/.dockerignore new file mode 100644 index 0000000000000..96d12ad527ea5 --- /dev/null +++ b/docker/dev/images/.dockerignore @@ -0,0 +1,68 @@ +artifacts/ +.git/ + +# intellij files +.idea/ +*.iml +*.ipr +*.iws +build-idea/ +out/ + +# include shared intellij config +!.idea/inspectionProfiles/Project_Default.xml +!.idea/runConfigurations/Debug_OpenSearch.xml +!.idea/vcs.xml + +# These files are generated in the main tree by annotation processors +benchmarks/src/main/generated/* +benchmarks/bin/* +benchmarks/build-eclipse-default/* +server/bin/* +server/build-eclipse-default/* +test/framework/build-eclipse-default/* + +# eclipse files +.project +.classpath +.settings +build-eclipse/ + +# netbeans files +nb-configuration.xml +nbactions.xml + +# gradle stuff +.gradle/ +build/ + +# vscode stuff +.vscode/ + +# testing stuff +**/.local* +.vagrant/ +/logs/ + +# osx stuff +.DS_Store + +# default folders in which the create_bwc_index.py expects to find old es versions in +/backwards +/dev-tools/backwards + +# needed in case docs build is run...maybe we can configure doc build to generate files under build? +html_docs + +# random old stuff that we should look at the necessity of... +/tmp/ +eclipse-build + +# projects using testfixtures +testfixtures_shared/ + +# These are generated from .ci/jobs.t +.ci/jobs/ + +# build files generated +doc-tools/missing-doclet/bin/ \ No newline at end of file diff --git a/docker/images/wi-dev.Dockerfile b/docker/dev/images/Dockerfile similarity index 67% rename from docker/images/wi-dev.Dockerfile rename to docker/dev/images/Dockerfile index 215b956d14a82..f49aa4b1aba6e 100644 --- a/docker/images/wi-dev.Dockerfile +++ b/docker/dev/images/Dockerfile @@ -1,7 +1,7 @@ FROM gradle:jdk17-alpine AS builder USER gradle -WORKDIR /home/wazuh-indexer/app -COPY --chown=gradle:gradle . /home/wazuh-indexer/app +WORKDIR /home/wazuh-indexer +COPY --chown=gradle:gradle . /home/wazuh-indexer RUN gradle clean @@ -12,7 +12,7 @@ RUN apk add git && \ chmod 0775 /home/wazuh-indexer && \ chown -R 1000:0 /home/wazuh-indexer USER wazuh-indexer -COPY --from=builder --chown=1000:0 /home/wazuh-indexer/app /home/wazuh-indexer/app -WORKDIR /home/wazuh-indexer/app -RUN git config --global --add safe.directory /home/wazuh-indexer/app +COPY --from=builder --chown=1000:0 /home/wazuh-indexer /home/wazuh-indexer +WORKDIR /home/wazuh-indexer +RUN git config --global --add safe.directory /home/wazuh-indexer EXPOSE 9200 9300 diff --git a/scripts/README.md b/scripts/README.md index 8c98f8206cab5..c83f20f3a3aac 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -29,16 +29,19 @@ act -j build -W .github/workflows/build.yml --artifact-server-path ./artifacts #### Running in Docker -Within the [Docker environment](../docker): +Using the [Docker environment](../docker): ```console -bash scripts/build.sh -v 2.11.0 -s false -p linux -a {x64|arm64} -d {rpm|deb|tar} +docker exec -it wi-build_$( @@ -104,7 +107,7 @@ The script will: ### Running in Act ```console -act -j assemble -W .github/workflows/build.yml --artifact-server-path ./artifacts --matrix distribution:deb --matrix architecture:x64 --var OPENSEARCH_VERSION=2.11.0 +act -j assemble -W .github/workflows/build.yml --artifact-server-path ./artifacts --matrix distribution:deb --matrix architecture:x64 --var OPENSEARCH_VERSION=2.11.1 [Build slim packages/build] 🏁 Job succeeded ``` @@ -115,33 +118,10 @@ Pre-requisites: - Current directory: `wazuh-indexer/` - Existing deb package in `wazuh-indexer/artifacts/dist/deb`, as a result of the _Build_ stage. +- Using the [Docker environment](../docker): ```console -MIN_PKG_PATH="./artifacts" -docker run --rm \ - -v ./scripts/:/home/wazuh-indexer/scripts \ - -v $MIN_PKG_PATH:/home/wazuh-indexer/artifacts \ - -v ./distribution/packages/src:/home/wazuh-indexer/distribution/packages/src \ - -w /home/wazuh-indexer \ - -it ubuntu:jammy /bin/bash - -# https://github.com/opensearch-project/opensearch-build/blob/2.11.1/docker/ci/dockerfiles/current/build.ubuntu2004.opensearch.x64.arm64.dockerfile - -# Install necessary packages -apt-get update -y && apt-get upgrade -y && apt-get install -y curl build-essential curl && - apt-get install -y debmake debhelper-compat && - apt-get install -y libxrender1 libxtst6 libasound2 libxi6 libgconf-2-4 && - apt-get install -y libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libatspi2.0-dev libxcomposite-dev libxdamage1 libxfixes3 libxfixes-dev libxrandr2 libgbm-dev libxkbcommon-x11-0 libpangocairo-1.0-0 libcairo2 libcairo2-dev libnss3 libnspr4 libnspr4-dev freeglut3 && - apt-get clean -y - -# Install aptly and required changes to debmake -# Remove lintian for now due to it takes nearly 20 minutes for OpenSearch as well as nearly an hour for OpenSearch-Dashboards during debmake -curl -o- https://www.aptly.info/pubkey.txt | apt-key add - && - echo "deb http://repo.aptly.info/ squeeze main" | tee -a /etc/apt/sources.list.d/aptly.list && - apt-get update -y && apt-get install -y aptly && apt-get clean -y && - dpkg -r lintian - -bash scripts/assemble.sh -v 2.11.0 -p linux -a x64 -d deb +docker exec -it wi-assemble_$(