olacabs / jackhammer

Jackhammer - One Security vulnerability assessment/management tool to solve all the security team problems.
https://jch.olacabs.com/userguide
Other
718 stars 162 forks source link

mysql container unhealthy #21

Closed sidheshenator closed 7 years ago

sidheshenator commented 7 years ago

When I start jackhammer containers, mysql container healthcheck returns unhealthy status. I tried restarting the just mysql container. Still it shows up as unhealthy.

sidheshenator@jackhammer:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS                     NAMES
300219770c48        jackhammer_web      "bash -c 'mkdir -p..."   13 minutes ago      Up 13 minutes               0.0.0.0:5000->3000/tcp    jackhammer_web_1
32c64f339133        redis               "docker-entrypoint..."   13 minutes ago      Up 13 minutes               0.0.0.0:32769->6379/tcp   jackhammer_redis_1
f397c19e49ef        mysql               "docker-entrypoint..."   13 minutes ago      Up 13 minutes (unhealthy)   0.0.0.0:3306->3306/tcp    jackhmmaer-db
kmadhusudhan commented 7 years ago

This is a docker issue, even it shows unhealthy jackhammer will be running

sidheshenator commented 7 years ago

docker-compose.yml contains healthcheck block -

   healthcheck:
     test: "nc -z localhost 3306"
     interval: 1s
     retries: 120

for the mysqldb service container. If that block is removed from docker-compose.yml and the application is built again, the unhealthy status goes away.

root@jackhammer-nginx:/home/sidheshenator/jackhammer# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                     NAMES
49fdb4f09a6e        jackhammer_web      "bash -c 'mkdir -p..."   About a minute ago   Up About a minute   0.0.0.0:5000->3000/tcp    jackhammer_web_1
afe17e2a4da3        redis               "docker-entrypoint..."   About a minute ago   Up About a minute   0.0.0.0:32784->6379/tcp   jackhammer_redis_1
15952b24200d        mysql               "docker-entrypoint..."   About a minute ago   Up About a minute   0.0.0.0:3306->3306/tcp    jackhmmaer-db

Another approach is to enter inside the mysqldb container and install nc. :)