how do I perform healthchecks on clamav using docker

1k Views Asked by At

I am deploying on AWS clamav

whos Dockerfile is :

FROM alpine:3.14
LABEL maintainer="Markus Kosmal <[email protected]>"

RUN apk add --no-cache bash clamav clamav-daemon clamav-libunrar

COPY conf /etc/clamav
COPY bootstrap.sh /
COPY envconfig.sh /
COPY check.sh /



RUN mkdir /var/run/clamav && \
    chown clamav:clamav /var/run/clamav && \
    chmod 750 /var/run/clamav && \
    chown -R clamav:clamav bootstrap.sh check.sh /etc/clamav && \
    chmod u+x bootstrap.sh check.sh 

EXPOSE 3310/tcp

USER clamav

CMD ["/bootstrap.sh"]

and since I am using a mirror I am testing locally using a docker-compose file

version: "3.7"

services:
   mirror:
     build:
       context: .
       dockerfile: mirror/Dockerfile

     ports:
        - "8080:8080"

  clamav:
    build:
      context: ../clamav
    environment:
      
       
      CLAMAVDATABASEMIRROR: "http://0.0.0.0:8080"
    
    depends_on:
       - mirror
    ports:
     - "3310:3310"

services work fine and when I run docker-compose up --build I can see from the logs that the services is pulling the daily update and stuff.

if I run docker container ls

I get that clamav has ports: 3310/tcp wheras the mirror has a mapped port on my local host

0.0.0.0:8080->8080/tcp

and I can run curl localhost:8080

But If I try and curl localhost on 3310 I get

curl: (52) Empty reply from server

now: how do I perform a healthcheck on the clamav service?

0

There are 0 best solutions below