Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

弄一个自启动脚本 #12

Closed
ptsa opened this issue Sep 15, 2017 · 5 comments
Closed

弄一个自启动脚本 #12

ptsa opened this issue Sep 15, 2017 · 5 comments

Comments

@ptsa
Copy link

ptsa commented Sep 15, 2017

新手不知道应该怎么写

@wahyd4
Copy link
Owner

wahyd4 commented Sep 15, 2017

童鞋已经很简单了啊。安装 docker 自动不了。

  1. 安装 docker, docker-compose
  2. clone 代码
  3. cd 到你需要的目录,docker-compose up -d

@ptsa
Copy link
Author

ptsa commented Sep 15, 2017

童靴 我说的是开机自启动, 不是自动安装

@wahyd4
Copy link
Owner

wahyd4 commented Sep 15, 2017 via email

wahyd4 added a commit that referenced this issue Sep 15, 2017
@wahyd4
Copy link
Owner

wahyd4 commented Sep 15, 2017

现在 docker 镜像在被意外停掉后就会自动重启了。前提是 docker 进程还在,比如,主机被强制重启。那么 docker 镜像会自动重启。
使用:

docker-compose stop
git pull
docker-compose up -d

@wahyd4 wahyd4 closed this as completed Sep 15, 2017
@lgh06
Copy link

lgh06 commented Jan 13, 2018

提醒。
CentOS7。应该在安装完Docker后执行这两句:

systemctl start docker.service
systemctl enable docker.service  

然后再docker-compose
(通过docker官网的script方式安装的docker,没有自动启动)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants