Skip to content

Commit 90528f9

Browse files
author
Wenyang Cao
committed
add health check to dockerfiles
Signed-off-by: Wenyang Cao <[email protected]>
1 parent f356439 commit 90528f9

16 files changed

+30
-0
lines changed

anax-in-container/Dockerfile.ubi.amd64

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,7 @@ ADD hzn /usr/bin/
3838
WORKDIR /root
3939
COPY script/anax.service /root/
4040

41+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD curl -sf http://localhost:8510/status > /dev/null || exit 1
42+
4143
# You can add a 2nd arg to this on the docker run cmd or the CMD statement in another dockerfile, to configure a specific environment
4244
ENTRYPOINT ["/root/anax.service", "start"]

anax-in-container/Dockerfile.ubi.arm64

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@ ADD hzn /usr/bin/
3737
WORKDIR /root
3838
COPY script/anax.service /root/
3939

40+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD curl -sf http://localhost:8510/status > /dev/null || exit 1
41+
4042
# You can add a 2nd arg to this on the docker run cmd or the CMD statement in another dockerfile, to configure a specific environment
4143
ENTRYPOINT ["/root/anax.service", "start"]

anax-in-container/Dockerfile.ubi.ppc64el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,7 @@ ADD hzn /usr/bin/
4242
WORKDIR /root
4343
COPY script/anax.service /root/
4444

45+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD curl -sf http://localhost:8510/status > /dev/null || exit 1
46+
4547
# You can add a 2nd arg to this on the docker run cmd or the CMD statement in another dockerfile, to configure a specific environment
4648
ENTRYPOINT ["/root/anax.service", "start"]

anax-in-container/Dockerfile.ubi.s390x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@ ADD hzn /usr/bin/
3737
WORKDIR /root
3838
COPY script/anax.service /root/
3939

40+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD curl -sf http://localhost:8510/status > /dev/null || exit 1
41+
4042
# You can add a 2nd arg to this on the docker run cmd or the CMD statement in another dockerfile, to configure a specific environment
4143
ENTRYPOINT ["/root/anax.service", "start"]

anax-in-container/Dockerfile_agbot.ubi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,7 @@ USER agbotuser
3535
WORKDIR /home/agbotuser
3636
RUN mkdir -p /home/agbotuser/policy.d
3737

38+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD curl -sf http://localhost:8046/status > /dev/null || exit 1
39+
3840
# Run the application
3941
ENTRYPOINT /usr/horizon/bin/agbot_start.sh

anax-in-k8s/Dockerfile.ubi.amd64

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ USER agentuser
3232
WORKDIR /home/agentuser
3333
RUN mkdir -p /home/agentuser/policy.d
3434

35+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD curl -sf http://localhost:8510/status > /dev/null || exit 1
36+
3537
ENTRYPOINT ["/home/agentuser/anax.service", "start"]

anax-in-k8s/Dockerfile.ubi.arm64

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ USER agentuser
3232
WORKDIR /home/agentuser
3333
RUN mkdir -p /home/agentuser/policy.d
3434

35+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD curl -sf http://localhost:8510/status > /dev/null || exit 1
36+
3537
ENTRYPOINT ["/home/agentuser/anax.service", "start"]

anax-in-k8s/Dockerfile.ubi.auto-upgrade-cron.amd64

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ RUN chown -R cronjobuser:cronjobuser /usr/local/bin/auto-upgrade-cronjob.sh /tmp
2828

2929
USER cronjobuser
3030
RUN chmod 755 /usr/local/bin/auto-upgrade-cronjob.sh
31+
32+
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD kill -0 1 || exit 1

anax-in-k8s/Dockerfile.ubi.auto-upgrade-cron.arm64

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ RUN chown -R cronjobuser:cronjobuser /usr/local/bin/auto-upgrade-cronjob.sh /tmp
2828

2929
USER cronjobuser
3030
RUN chmod 755 /usr/local/bin/auto-upgrade-cronjob.sh
31+
32+
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD kill -0 1 || exit 1

anax-in-k8s/Dockerfile.ubi.auto-upgrade-cron.ppc64el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ RUN chown -R cronjobuser:cronjobuser /usr/local/bin/auto-upgrade-cronjob.sh /tmp
3333

3434
USER cronjobuser
3535
RUN chmod 755 /usr/local/bin/auto-upgrade-cronjob.sh
36+
37+
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD kill -0 1 || exit 1

anax-in-k8s/Dockerfile.ubi.auto-upgrade-cron.s390x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ RUN chown -R cronjobuser:cronjobuser /usr/local/bin/auto-upgrade-cronjob.sh /tmp
3131

3232
USER cronjobuser
3333
RUN chmod 755 /usr/local/bin/auto-upgrade-cronjob.sh
34+
35+
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD kill -0 1 || exit 1

anax-in-k8s/Dockerfile.ubi.ppc64el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ USER agentuser
3737
WORKDIR /home/agentuser
3838
RUN mkdir -p /home/agentuser/policy.d
3939

40+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD curl -sf http://localhost:8510/status > /dev/null || exit 1
41+
4042
ENTRYPOINT ["/home/agentuser/anax.service", "start"]

anax-in-k8s/Dockerfile.ubi.s390x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ USER agentuser
3535
WORKDIR /home/agentuser
3636
RUN mkdir -p /home/agentuser/policy.d
3737

38+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD curl -sf http://localhost:8510/status > /dev/null || exit 1
39+
3840
ENTRYPOINT ["/home/agentuser/anax.service", "start"]

css/image/cloud-sync-service-amd64/Dockerfile.ubi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ COPY script/css_start.sh /usr/edge-sync-service/bin
2525
USER cssuser
2626

2727
CMD ["/usr/edge-sync-service/bin/css_start.sh"]
28+
29+
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD grep -q css_start.sh /proc/1/cmdline || exit 1

css/image/cloud-sync-service-arm64/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ ADD cloud-sync-service /cloud-sync-service/
66

77
CMD ["/cloud-sync-service/cloud-sync-service"]
88

9+
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD grep -q css_start.sh /proc/1/cmdline || exit 1

css/image/cloud-sync-service-armhf/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ ADD cloud-sync-service /cloud-sync-service/
66

77
CMD ["/cloud-sync-service/cloud-sync-service"]
88

9+
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD grep -q css_start.sh /proc/1/cmdline || exit 1

0 commit comments

Comments
 (0)