Add verification for binary Zabbix components after installing dependencies

This commit is contained in:
Alexey Pustovalov
2024-12-25 14:28:21 +09:00
parent 69e5fe3277
commit a7ccbb54b9
59 changed files with 123 additions and 104 deletions

View File

@ -91,6 +91,7 @@ RUN set -eux && \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
chgrp -R 0 ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
chmod -R g=u ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/
/usr/sbin/zabbix_proxy -V
EXPOSE 10051/TCP

View File

@ -36,6 +36,7 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/proxy/conf/", "${ZABBIX_
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/", "/usr/bin/"]
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
tini \
@ -108,7 +109,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
chgrp -R 0 ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
chmod -R g=u ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
microdnf -y clean all
/usr/sbin/zabbix_proxy -V
EXPOSE 10051/TCP

View File

@ -37,6 +37,7 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/", "/usr/bin
COPY ["conf/etc/yum.repos.d/oracle-epel-ol9.repo", "/etc/yum.repos.d/oracle-epel-ol9.repo"]
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
libevent \
@ -95,7 +96,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
chgrp -R 0 ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
chmod -R g=u ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
microdnf -y clean all
/usr/sbin/zabbix_proxy -V
EXPOSE 10051/TCP

View File

@ -55,6 +55,7 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/proxy/conf/", "${ZABBIX_
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/", "/usr/bin/"]
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
--mount=type=bind,target=/run/secrets/,src=secrets/ \
set -eux && \
INSTALL_PKGS="bash \
@ -128,7 +129,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
chgrp -R 0 ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
chmod -R g=u ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
microdnf -y clean all
/usr/sbin/zabbix_proxy -V
EXPOSE 10051/TCP

View File

@ -35,7 +35,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/proxy/sbin/zabbix_proxy"
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/proxy/conf/", "${ZABBIX_CONF_DIR}/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/", "/usr/bin/"]
RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--mount=type=cache,target=/var/lib/apt/,sharing=locked \
set -eux && \
echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \
INSTALL_PKGS="bash \
@ -93,7 +94,7 @@ RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
chgrp -R 0 ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
chmod -R g=u ${ZABBIX_CONF_DIR}/ ${ZABBIX_USER_HOME_DIR}/ && \
apt-get -y autoremove
/usr/sbin/zabbix_proxy -V
EXPOSE 10051/TCP