Home > Net >  How to check running containers in -bash
How to check running containers in -bash

Time:10-30

blue_is_run=$(docker exec blue echo 'yes' 2> /dev/null || echo 'no')

There is a code that checks if the container is running by full name. If the red container is running, it will return yes. How to search for a container that has the text -red- in the middle

CodePudding user response:

Список запущенных контейнеров выдаёт команда docker ps

Example: docker ps | grep -- '-blue-' > /dev/null && echo yes || echo no

  • Related