Skip to content

Instantly share code, notes, and snippets.

@luos
Created April 8, 2016 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luos/a32dae9d0b4496e5caa97411084cdd60 to your computer and use it in GitHub Desktop.
Save luos/a32dae9d0b4496e5caa97411084cdd60 to your computer and use it in GitHub Desktop.
Automatically attach bash to the first docker container - useful for debugging
#!/bin/bash
CONTAINER_ID=`docker ps | awk '{ print $1 }' | tail -n +2`
docker exec -ti $CONTAINER_ID bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment