禁用docker-compose项目的自动启动 [英] Disable autostart of docker-compose project

查看:1108
本文介绍了禁用docker-compose项目的自动启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Docker for Mac的docker-compose项目,该项目在启动计算机时会自动启动.

I have a docker-compose project using Docker for Mac that autostarts when I boot the computer.

我通常使用docker-compose up -d启动项目,但即使在关闭之前运行docker-compose stop,也会在启动时自动重新启动该项目.

I usually start the project with docker-compose up -d, but even running docker-compose stop before shutting down autostarts it again on boot.

我不知道具体启用此功能.如何禁用它?

I am not aware of specifically enabling this. How can I disable it?

推荐答案

今天,我遇到了一个同样的问题,因为在.yml文件中设置了restart: always,所以在启动我的开发笔记本电脑时启动了所有容器.

Today I had the same issue that all containers are started when I boot my dev laptop, as restart: always was set in the .yml files.

由于我不想触摸.yml文件,所以我刚刚发现了(thx Bobby)如何通过以下方式更改此设置:

As I don't want to touch the .yml files, I just found out (thx Bobby) how to alter this setting by:

docker update --restart=no <MY-CONTAINER-ID>

这篇关于禁用docker-compose项目的自动启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆