Home  >  Article  >  Operation and Maintenance  >  How to check the created container ID in docker

How to check the created container ID in docker

尚
Original
2020-03-24 13:58:3017518browse

How to check the created container ID in docker

Two ways to query the container id

1. Use docker ps -aqf “name=containername”

2. docker inspect --format= "{{.Id}}" container_name

Instance:

Method 1:

[root@node1 filebeat]# docker ps -aqf "name=test2"
0f0b77cd0c53
[root@node1 filebeat]#

Method 2:

# docker inspect --format="{{.Id}}"  test2
0f0b77cd0c53e82193c5e2e9b18d1e18a0d4dc77094284f0f6761cff76925eb2

More related tutorials , please pay attention to the docker tutorial column of the PHP Chinese website.

The above is the detailed content of How to check the created container ID in docker. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn