Skip to content

Instantly share code, notes, and snippets.

@pbrandiezs
Last active June 29, 2018 21:37
Show Gist options
  • Save pbrandiezs/b27b655f94a3d2b3636636a86bf79505 to your computer and use it in GitHub Desktop.
Save pbrandiezs/b27b655f94a3d2b3636636a86bf79505 to your computer and use it in GitHub Desktop.
Quick docker command samples
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