Home  >  Q&A  >  body text

docker 如何查看已存在容器的创建命令

docker 如何查看已存在容器的创建命令

我想大声告诉你我想大声告诉你2756 days ago973

reply all(4)I'll reply

  • 为情所困

    为情所困2017-04-26 09:03:46

    If you want to see the container creation command, it seems not possible, but you can see the detailed information of the container, which includes data volumes, environment variables, and commands to start and execute the container.

    docker inspect ${psid}

    reply
    0
  • 迷茫

    迷茫2017-04-26 09:03:46

    docker ps

    Usage: docker ps [OPTIONS]
    
    List containers
    
    Options:
      -a, --all             Show all containers (default shows just running)
      -f, --filter value    Filter output based on conditions provided (default [])
                            - exited=<int> an exit code of <int>
                            - label=<key> or label=<key>=<value>
                            - status=(created|restarting|running|paused|exited)
                            - name=<string> a container's name
                            - id=<ID> a container's ID
                            - before=(<container-name>|<container-id>)
                            - since=(<container-name>|<container-id>)
                            - ancestor=(<image-name>[:tag]|<image-id>|<image@digest>)
                              containers created from an image or a descendant.
          --format string   Pretty-print containers using a Go template
          --help            Print usage
      -n, --last int        Show n last created containers (includes all states) (default -1)
      -l, --latest          Show the latest created container (includes all states)
          --no-trunc        Don't truncate output
      -q, --quiet           Only display numeric IDs
      -s, --size            Display total file sizes

    reply
    0
  • 黄舟

    黄舟2017-04-26 09:03:46

    docker ps -as
    View all containers, including exited containers, and list the container size.

    reply
    0
  • 漂亮男人

    漂亮男人2017-04-26 09:03:46

    docker exec -it myphp-fpm bash enters the container myphp-fpm This is the container name

    Reference article /a/11...

    reply
    0
  • Cancelreply