V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
niuoh
V2EX  ›  Docker

问一个 docker 小白问题!

  •  
  •   niuoh · 2016-05-07 16:33:31 +08:00 · 3271 次点击
    这是一个创建于 2918 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我 pull 下来了一个阿里云的 docker lnmp 镜像 在我的个人电脑上 连续运行了两天之后 docker stop 掉了 然后再 docker ps -l 咋看不到了呢 还好停止之前以前把容器里网站迁出来了 一般不是 docker stop 之后能在 docker ps -l 里还能看到并继续运行吗 这是什么情况??

    6 条回复    2016-05-07 18:39:46 +08:00
    cuiweiqiang
        1
    cuiweiqiang  
       2016-05-07 16:36:36 +08:00 via iPhone
    docker ps -a
    YUX
        2
    YUX  
       2016-05-07 16:38:59 +08:00
    小白用 DaoCloud 操作 Docker 会容易很多

    我的博客内有些用 DaoCloud 控制台部署 Docker 你内容给你参考 https://www.yux-io.com/
    niuoh
        3
    niuoh  
    OP
       2016-05-07 17:08:09 +08:00
    @cuiweiqiang 看到了 docker ps -l 和-a 的区别是啥 还有-a 下有好多啊 我怎么清空?
    niuoh
        4
    niuoh  
    OP
       2016-05-07 17:10:47 +08:00
    @cuiweiqiang 找到了 docker rm -f $(docker ps -a -q)这条命令来清空所有容器
    derek80
        5
    derek80  
       2016-05-07 17:18:55 +08:00
    zdkmygod
        6
    zdkmygod  
       2016-05-07 18:39:46 +08:00
    @niuoh

    $ docker ps --help

    Usage: docker ps [OPTIONS]

    List containers

    -a, --all=false Show all containers (default shows just running)
    --before= Show only container created before Id or Name
    -f, --filter=[] Filter output based on conditions provided
    --format= Pretty-print containers using a Go template
    --help=false Print usage
    -l, --latest=false Show the latest created container, include non-running
    -n=-1 Show n last created containers, include non-running
    --no-trunc=false Don't truncate output
    -q, --quiet=false Only display numeric IDs
    -s, --size=false Display total file sizes
    --since= Show created since Id or Name, include non-running
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2263 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 09:31 · PVG 17:31 · LAX 02:31 · JFK 05:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.