Created
October 27, 2021 14:15
-
-
Save muratgozel/20d99fce6ede74c8108f123248d711fd to your computer and use it in GitHub Desktop.
Find docker service id by service name in docker compose.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {execSync} from 'child_process' | |
const service = 'some_service' | |
const containerId = execSync(`docker ps -f name=${service} --quiet`).toString().trim() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment