NAME=someapp_api; CMD=bash; docker exec -it `docker ps -f name="${NAME}" --format '{{.ID}}' | head -n 1` ${CMD}
Created
December 6, 2022 11:08
-
-
Save refo/203d921e066c1893d60736c576a0dfe1 to your computer and use it in GitHub Desktop.
Docker exec by name: Search containers by name and exec on the first container
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment