Where are the quarantine and sanitized folders located after mounting them from the MD Core container to the Ubuntu host machine?

When you mount the quarantine and sanitized folders to the host machine as shown below (Docker image published on OPSWAT Docker Hub - MetaDefender Core)

However, you won’t see any files inside /tmp/metadefender/quarantine or /tmp/metadefender/sanitized. If Docker was installed via SNAP, the mounted folders under /tmp will be relocated to /tmp/snap-private-tmp/snap.docker/tmp/metadefender. For example, the image below:

Why is this happening?

  • Snap's confinement

    • Snap applications (including Docker installed via Snap) cannot access arbitrary paths outside their sandbox.
    • This means /tmp/metadefender/quarantine might be remapped to a Snap-specific directory.
  • Snap redirects /tmp

    • When running inside a Snap package, /tmp is not the real system /tmp.
    • Instead, it maps to /var/snap/docker/common/tmp/ or similar.

How to Fix It?

Option 1: Use /var/snap/docker/common/tmp/ Instead of /tmp/.Try using:

This ensures the directory is accessible within Snap's confinement.

Option 2: Use a Different Path (Outside /tmp)

Instead of /tmp/, try mounting from a permanent directory like /mnt or /opt:

or

These paths are not affected by Snap’s security restrictions.

Option 3: Reinstall Docker Without Snap

If you want full control over Docker's behavior, consider removing Snap’s Docker and installing it manually:

  1. Remove Docker from Snap:
  1. Install Docker via the official package:
  1. Try mounting the volume again:
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
On This Page