You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何查看Docker本地已保存/已停止的实例?

查看本地已停止/已保存的Docker容器(实例)

Hey there! First, let's clear up a key terminology mix-up to avoid confusion:

  • Images (docker images): These are the immutable, read-only templates used to spin up containers.
  • Containers: These are the running (or stopped) instances created from images—this is exactly what you're referring to as "镜像实例".

核心命令:查看所有容器(含运行中和已停止的)

To see every container on your local system (whether it's running, stopped, or exited), run this command:

docker ps -a

The -a flag stands for "all", which tells Docker to list containers in all states, not just active running ones. You'll get details like container ID, name, the parent image it was built from, current status, and more.

只筛选已停止/已退出的容器

If you want to narrow down the list to only show stopped or exited containers, use a filter flag:

docker ps -f "status=exited"

You can also filter for other states like created (containers made but never started) or restarting if you need to target specific container types.

自定义格式化输出(让信息更易读)

For a cleaner, tailored view, use the --format option to pick exactly what details you want to display:

docker ps -a --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.CreatedAt}}"

This will output a tidy table with container names, their source image, current status, and creation timestamp—perfect for quick scans.

启动容器后查看所有实例

After you start a container with docker start <instance_name>, running docker ps -a will still show all containers, including the one you just launched (now marked as "Up" in the status column). If you only want to see currently running containers, use the basic docker ps command without the -a flag.


内容的提问来源于stack exchange,提问作者WestCoastProjects

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 09:26:23