Get only the ID of the container specified by docker ps


docker ps -f "name=postgres*" -q

Convenient usage

--You don't have to check the ID one by one

docker exec -it $(docker ps -f "name=postgres*" -q) psql -c 'DROP DATABASE testdb'

Recommended Posts

Get only the ID of the container specified by docker ps
Get the ID of automatic numbering
The story of updating SonarQube's Docker Container
Change the location folder of Docker image & container
How to display the amount of disk used by Docker container for each container
[Swift] How to get the document ID of Firebase
Docker monitoring-explaining the basics of basics-
Get the URL issued by ngrok with the Docker expose plugin
Install by specifying the version of Django in the Docker environment
Understand the basics of docker
I've only heard of Docker ...
Nginx container that displays the Hostname of the host running Docker
[Docker] Delete only the volume associated with a specific container
I want to narrow down the display of docker ps
Check the contents by docker pull from ECR and start the container
How to get the id of PRIMAY KEY auto_incremented in MyBatis
Qualify only part of the text
Summary of Docker understanding by beginners ⑤ ~ Until deploying docker container on EC2 instance ~
[Error] Error during Docker build (solved by pulling the latest version of image)
Get the value of enum saved in DB by Rails with attribute_before_type_cast
I want to get a list of only unique character strings by excluding fixed character strings from the file name
Get the result of POST in Java
[Java] Get the day of the specific day of the week
The identity of params [: id] in rails
Introducing the features of JavaFX SceneBuilder container
The process of understanding Gemfile by non-engineers
[Swift] Termination of the program by assertion
[Swift] Get the height of Safe Area
[Docker] Start the container as soon as possible
Japanese setting of mysql in Docker container
The contents of the data saved by CarrierWave.
[Ruby on Rails] How to make the link destination part of the specified id
How to get the ID of a user authenticated with Firebase in Swift
Up to the point of launching a Docker container built using RedHat Quarkus
Get the class name and method name of Controller executed by HandlerInterceptor of Spring Boot