Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1K
Views
Docker - duplicate mount point

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?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

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

docker-compose down; then docker compose up

over 4 years ago · Santiago Trujillo Report

0

Just in case anyone is still having this issue, it looks like this is the bugfix, which will presumably be released in the version after Docker Desktop v3.4.0:

https://github.com/docker/compose-cli/pull/1782

And the workaround until that makes it into the production docker compose cli is to make sure to use the exact same path (either with or without trailing slash) in the Dockerfile and the docker-compose.yml

over 4 years ago · Santiago Trujillo Report

0

This issue seams to occur when you have multiple volume declarations mostly in docker-compose.yml and Dockerfile. The solution is to remove VOLUME declaration in your Dockerfile or docker-compose.yml eg.

version: '3.5'
services:
    test:
        build: .
        volumes: 
        - /mnt/tmpfs

Docker file:

FROM alpine:3.4

VOLUME /mnt/tmpfs

CMD /bin/sh

I removed the one from the Dockerfile.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!