Last active
June 29, 2018 21:37
-
-
Save pbrandiezs/b27b655f94a3d2b3636636a86bf79505 to your computer and use it in GitHub Desktop.
Quick docker command samples
This file contains 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
Sample using a filter to run a command in the container: | |
docker exec `docker ps -q --filter name=frosty_goldberg` /bin/echo Hello | |
Start the container with a label: | |
docker run --label="the_label" -td ubuntu | |
Use the label to identify the container and run a command in it: | |
docker exec `docker ps -q --filter label=the_label` /bin/echo Hello | |
Use the label to identify the container and kill the container: | |
docker kill `docker ps -q --filter label=the_label` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment