Mongo on Azure Container App crash when mounted a volume to /data/db

50 Views Asked by At

Good morning,

I have been trying for several hours to mount my share files volume on my Mongo Container.

Here my configuration screens even if logically the problem does not come from there because I can mount the volume on another path.

enter image description here enter image description here enter image description here

Tests performed:

  • When I launch my container without volume it works
  • When I launch my container with a mount volume on a path other than /data/db it works (/data/db2)
  • When I launch a local container (Docker desktop) with a mount volume on /data/db it works

I don't know why but I have the impression that my Azure Share files overwrite everything in the path on which I mount it.

Do you have an idea ?

Thanks !

1

There are 1 best solutions below

0
avo On

I believe your assumption is correct.

see: https://learn.microsoft.com/en-us/azure/container-instances/container-instances-volume-azure-files

Mounting an Azure Files share to a container instance is similar to a Docker bind mount. If you mount a share into a container directory in which files or directories exist, the mount obscures files or directories, making them inaccessible while the container runs.

You could mount it somewhere else and pass the directory to the mongo command via --dbpath