skip to Main Content

How to stop docker on vm shutdown under Linux

I have 3 dockers container running, and i want stop container before shutdown the vm. I create one file : /etc/systemd/system/unmount-disks.service [Unit] Description=Démontage des disques externes et NAS avant arrêt DefaultDependencies=no Before=docker.service shutdown.target reboot.target halt.target [Service] Type=oneshot ExecStart=/usr/local/bin/unmount_disks.sh RemainAfterExit=true Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"…

VIEW QUESTION
Back To Top
Search