Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker - duplicate mount point

Tags:

I use the Docker ClamAV image in my docker-compose.yml like this:

version: '3.7'
services:
  clamav_updater:
    image: quay.io/ukhomeofficedigital/clamav:latest
    ports:
      - "3310:3310"
    volumes:
      - type: bind
        source: /home/misc/docker/efs_clamav
        target: /var/lib/clamav

This service is planned to be the "updater"/"writer". This means it will download updates into /var/lib/clamav, and since this is a mounted volume with source: /home/misc/docker/efs_clamav - the reader nodes (that will not run the update command) will be able to get the updated files from that folder.

This is all in theory. In practice, when I run this image I get the following error:

ERROR: for clamav_writer Cannot create container for service clamav_writer: Duplicate mount point: /var/lib/clamav

I understand that this is due to the fact that the Dockerfile already set the same directory as a volume:

VOLUME /var/lib/clamav

Is there anyway I can still set that volume in my docker-compose.yml file (so that I can set the source directory for other readers to read from?

like image 978
Cauthon Avatar asked Jul 01 '19 08:07

Cauthon


1 Answers

A comment from @hs-dev2 looks like the right answer:

docker-compose down; then docker compose up

like image 67
Steve Scott Avatar answered Sep 20 '22 15:09

Steve Scott