0

I have an old laptop that has a few docker-compose projects with restart=unless-stopped. One of them is possibly causing the laptop to crash on start. The laptop then crashes before I have a chance to stop that container.

I can mount the underlying linux system by booting from a USB and so can access the docker-compose.yml files.

How can I disable the restart policy (possibly once off) so when I boot the laptop, it doesn't start those docker-compose containers?

Can this be done without editting the docker-compose.yml files?

Tom Malkin
  • 2,134
  • 2
  • 19
  • 35
  • 3
    Does this answer your question? [How to prevent docker from starting a container automatically on system startup?](https://stackoverflow.com/questions/40513545/how-to-prevent-docker-from-starting-a-container-automatically-on-system-startup) one of the answers tells you where the files to edit are as opposed to Docker commands – dpwr Jan 16 '21 at 05:31
  • Thanks @dpwrussell, it does. The answer lies in editing that file, and if you have a lot of them (and you don't know which is which because the docker daemon isn't running), a simple script that updates each one to `RestartPolicy.Name = ""` should work – Tom Malkin Jan 17 '21 at 21:58

0 Answers0