0

Dockerfile

ARG BASE_PROCESS_JRE_IMAGE
ARG BASE_PROCESS_JRE_IMAGE_TAG

FROM ${BASE_PROCESS_JRE_IMAGE}:${BASE_PROCESS_JRE_IMAGE_TAG}

# Update OS and add required tools
RUN echo "===> Installing nc clamav clamav-update clamd...." && \
    yum install -y \
        nc \
        clamav-0.103.1 \
        clamav-update-0.103.1 \
        clamd-0.103.1 && \
    yum clean all && \
    rm -rf /var/cache/yum

COPY config/freshclam.conf /etc/freshclam.conf
COPY config/scan.conf /etc/clamd.d/scan.conf

EXPOSE 3310/tcp
VOLUME ["/store"]

RUN echo "===> Downloading virus definitions..."  && \
    /usr/bin/freshclam

CMD ["/start-server.sh"]

When I try to build the docker image from this Dockerfile, the virus definitions are not in the final image. All these steps run in their own intermediate image and once executed, this intermediate image gets destroyed. I want the output of /usr/bin/freshclam run to be persisted during image creation only in my final image as this command downloads the clam-av virus definitions.

Can someone suggest how this can be achieved?

ashishb
  • 81
  • 2
  • 11

0 Answers0