This commit is contained in:
2024-06-23 19:44:47 +03:00
parent 1b9f61d560
commit 2de6b68f7d
2 changed files with 5 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ STOPSIGNAL SIGTERM
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/bin/zabbix_agent2", "/usr/sbin/zabbix_agent2"] COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/bin/zabbix_agent2", "/usr/sbin/zabbix_agent2"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_agentd.conf", "/etc/zabbix/zabbix_agent2.conf"] COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_agentd.conf", "/etc/zabbix/zabbix_agent2.conf"]
# COPY run.sh /run.sh COPY run.sh /run.sh
COPY rootfs / COPY rootfs /
RUN set -eux && \ RUN set -eux && \
@@ -54,9 +54,7 @@ RUN set -eux && \
--home /var/lib/zabbix/ \ --home /var/lib/zabbix/ \
zabbix && \ zabbix && \
adduser zabbix docker && \ adduser zabbix docker && \
# echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \ echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
echo "zabbix ALL=(root) NOPASSWD: ALL" >> /etc/sudoers.d/zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \ mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix && \
@@ -67,6 +65,7 @@ RUN set -eux && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \ chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \ chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \
chmod a+x /etc/services.d/zabbix_agent2/run && \ chmod a+x /etc/services.d/zabbix_agent2/run && \
chmod a+x /run.sh && \
chmod a+x /etc/services.d/zabbix_agent2/finish chmod a+x /etc/services.d/zabbix_agent2/finish
EXPOSE 10050/TCP 31999/TCP EXPOSE 10050/TCP 31999/TCP
@@ -81,4 +80,4 @@ WORKDIR /var/lib/zabbix
USER 1997 USER 1997
# CMD ["/usr/sbin/zabbix_agent2", "--foreground", "-c", "/config/zabbix_agent2.conf"] # CMD ["/usr/sbin/zabbix_agent2", "--foreground", "-c", "/config/zabbix_agent2.conf"]
# CMD [ "/run.sh" ] CMD [ "/run.sh" ]

View File

@@ -12,7 +12,7 @@ arch:
- i386 - i386
startup: system startup: system
boot: auto boot: auto
init: false init: true
full_access: true full_access: true
host_ipc: true host_ipc: true
host_pid: true host_pid: true