forked from wazuh/wazuh-docker
add variables from wazuh version
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2)
|
||||
FROM ubuntu:focal AS builder
|
||||
|
||||
ARG WAZUH_VERSION=4.3.0
|
||||
ARG WAZUH_VERSION
|
||||
ARG INSTALL_DIR=/usr/share/wazuh-dashboard
|
||||
|
||||
# Update and install dependencies
|
||||
@@ -24,8 +24,9 @@ RUN $INSTALL_DIR/bin/opensearch-dashboards-keystore create --allow-root && \
|
||||
echo kibanaserver | $INSTALL_DIR/bin/opensearch-dashboards-keystore add opensearch.username --stdin --allow-root && \
|
||||
echo kibanaserver | $INSTALL_DIR/bin/opensearch-dashboards-keystore add opensearch.password --stdin --allow-root
|
||||
|
||||
# Install Wazuh App
|
||||
RUN $INSTALL_DIR/bin/opensearch-dashboards-plugin install https://packages.wazuh.com/4.x/ui/dashboard/wazuh-${WAZUH_VERSION}.zip --allow-root
|
||||
COPY config/install_wazuh_app.sh /
|
||||
RUN chmod 775 /install_wazuh_app.sh
|
||||
RUN bash /install_wazuh_app.sh
|
||||
|
||||
# Copy and set permissions to config files
|
||||
COPY config/opensearch_dashboards.yml $INSTALL_DIR/config/
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
## Variables
|
||||
WAZUH_IMAGE_VERSION=$(echo $WAZUH_VERSION | sed -e 's/\.//g')
|
||||
WAZUH_ACTUAL_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2- | sed -e 's/\.//g')
|
||||
echo $WAZUH_IMAGE_VERSION
|
||||
echo $WAZUH_ACTUAL_VERSION
|
||||
## If wazuh manager exists in apt dev repository, change variables, if not exit 1
|
||||
if [ "$WAZUH_IMAGE_VERSION" -le "$WAZUH_ACTUAL_VERSION" ]; then
|
||||
WAZUH_APP=https://packages.wazuh.com/4.x/ui/dashboard/wazuh-${WAZUH_VERSION}.zip
|
||||
else
|
||||
WAZUH_APP=https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-${WAZUH_VERSION}.zip
|
||||
fi
|
||||
|
||||
# Install Wazuh App
|
||||
$INSTALL_DIR/bin/opensearch-dashboards-plugin install $WAZUH_APP --allow-root
|
||||
Reference in New Issue
Block a user