0

I have an image of php7.2 which is now working in production mode. When I tried to create a service of the current image , I got "cannot mount volume over existing file, file exists /var/lib/docker/overlay2/4726faf1f3b385e805dec93e0e411acf322ca5ba6d5fd24666c24cb2f85ef810/merged/usr/local/etc/php/conf.d/local.ini"

I have tried by removing local.ini from the stack , but no change happened. Is there any way to fix this error?

AliMahdavi
  • 109
  • 2
  • 10
  • Did you try simply removing this file from the host you're running your image on? I.e. `sudo rm -f /var/lib/docker/overlay2/4726faf1f3b385e805dec93e0e411acf322ca5ba6d5fd24666c24cb2f85ef810/merged/usr/local/etc/php/conf.d/local.ini` – sfb103 Sep 16 '20 at 05:44
  • Thanks for your comment , but I cannot remove that volume because it is being used by other containers. – AliMahdavi Sep 17 '20 at 14:32

1 Answers1

0

Finally, as I could not remove the volume because it was being used by the other containers , I mounted that volume into my new swarm containers using swarm stack deploy command and docker compose.

AliMahdavi
  • 109
  • 2
  • 10