Skip to content

Commit

Permalink
hotfix(s6-overlay): support for multiarch
Browse files Browse the repository at this point in the history
  • Loading branch information
kalingth committed Jul 29, 2024
1 parent 87133db commit d4a9ea5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.8.1
4.7.0
16 changes: 5 additions & 11 deletions wazuh-manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,17 @@ ARG WAZUH_FILEBEAT_MODULE

RUN apt-get update && apt install curl apt-transport-https lsb-release gnupg zip -y

COPY config/check_repository.sh /
RUN chmod 775 /check_repository.sh
COPY --chmod=755 config/check_repository.sh /
RUN source /check_repository.sh

RUN apt-get update && \
apt-get install wazuh-manager=${WAZUH_VERSION}-${WAZUH_TAG_REVISION}
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
COPY --chmod=755 config/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-arm.tar.gz \
-o /tmp/s6-overlay-arm.tar.gz && \
tar xzf /tmp/s6-overlay-arm.tar.gz -C / --exclude="./bin" && \
tar xzf /tmp/s6-overlay-arm.tar.gz -C /usr ./bin && \
rm /tmp/s6-overlay-arm.tar.gz
COPY --chmod=755 config/s6-overlay-install.sh /
RUN /s6-overlay-install.sh && rm /s6-overlay-install.sh

COPY config/etc/ /etc/
COPY --chown=root:wazuh config/create_user.py /var/ossec/framework/scripts/create_user.py
Expand Down
18 changes: 18 additions & 0 deletions wazuh-manager/config/s6-overlay-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

function getArchBasedS6Version() {
case $(arch) in
'aarch64' | 'arm64') echo "s6-overlay-aarch64.tar.gz" ;;
'x86_64' | 'amd64') echo "s6-overlay-amd64.tar.gz" ;;
*)
echo "Architecture $(arch) not supported" >> /dev/stderr;
exit 1;
;;
esac
}

S6_FILE=$(getArchBasedS6Version);
curl -fsLo "/tmp/${S6_FILE}" "https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/${S6_FILE}";
tar xzf "/tmp/${S6_FILE}" -C / --exclude="./bin";
tar xzf "/tmp/${S6_FILE}" -C /usr ./bin;
rm "/tmp/${S6_FILE}";

0 comments on commit d4a9ea5

Please sign in to comment.