forked from wazuh/wazuh-docker
add variables from wazuh version
This commit is contained in:
@@ -1,17 +1,22 @@
|
||||
# Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2)
|
||||
FROM ubuntu:focal
|
||||
|
||||
ARG WAZUH_VERSION=4.3.0
|
||||
ARG TEMPLATE_VERSION=4.3
|
||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
||||
|
||||
ARG WAZUH_VERSION
|
||||
ARG TEMPLATE_VERSION=4.2
|
||||
ARG FILEBEAT_CHANNEL=filebeat-oss
|
||||
ARG FILEBEAT_VERSION=7.10.2
|
||||
ARG WAZUH_FILEBEAT_MODULE="wazuh-filebeat-0.1.tar.gz"
|
||||
|
||||
RUN apt-get update && apt install curl apt-transport-https lsb-release gnupg -y
|
||||
|
||||
RUN apt-key adv --fetch-keys https://packages.wazuh.com/key/GPG-KEY-WAZUH && \
|
||||
echo "deb https://packages.wazuh.com/4.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list && \
|
||||
apt-get update && \
|
||||
COPY config/check_repository.sh /
|
||||
|
||||
RUN chmod 775 /check_repository.sh
|
||||
RUN source /check_repository.sh
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install wazuh-manager=${WAZUH_VERSION}-1
|
||||
|
||||
RUN curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/${FILEBEAT_CHANNEL}-${FILEBEAT_VERSION}-amd64.deb &&\
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
## 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')
|
||||
## If wazuh manager exists in apt dev repository, change variables, if not exit 1
|
||||
if [ "$WAZUH_IMAGE_VERSION" -le "$WAZUH_ACTUAL_VERSION" ]; then
|
||||
APT_KEY=https://packages.wazuh.com/key/GPG-KEY-WAZUH
|
||||
REPOSITORY="deb https://packages.wazuh.com/4.x/apt/ stable main"
|
||||
else
|
||||
APT_KEY=https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH
|
||||
REPOSITORY="deb https://packages-dev.wazuh.com/pre-release/apt/ unstable main"
|
||||
fi
|
||||
apt-key adv --fetch-keys ${APT_KEY}
|
||||
echo ${REPOSITORY} | tee -a /etc/apt/sources.list.d/wazuh.list
|
||||
Reference in New Issue
Block a user