建立持久化的容器

目录

    ** 容器 状态 **

    1. 运行
    2. 已暂停
    3. 重新启动
    4. 已退出

    自动重启容器

    1. 构建一个总是重新启动并简单打印时间的容器,并查看日志

      docker run -d --name backoff-detector --restart always busybox date
      docker logs -f backoff-detector

    2. 使用init和supervisor 进程维持容器运行状态

      docker run -d -p 80:80 --name lamp-test tutum/lamp
      docker top lamp-test #查看容器中的进程

    原文地址:https://www.cnblogs.com/Ethan2lee/p/7472758.html