Skip to content

Commit

Permalink
Use mysql client for healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano committed Jan 22, 2019
1 parent ded9ad4 commit 5715a7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions metricbeat/module/mysql/_meta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG MYSQL_IMAGE=mysql:5.7.12
FROM $MYSQL_IMAGE
RUN apt-get update && apt-get install -y netcat
HEALTHCHECK --interval=1s --retries=90 CMD nc -z localhost 3306

ENV MYSQL_ROOT_PASSWORD test

HEALTHCHECK --interval=1s --retries=90 CMD mysql -p$MYSQL_ROOT_PASSWORD -P 3306 -e "SELECT 1"

COPY test.cnf /etc/mysql/conf.d/test.cnf
2 changes: 2 additions & 0 deletions metricbeat/module/mysql/_meta/test.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mysqld]
bind-address = 0.0.0.0

0 comments on commit 5715a7e

Please sign in to comment.