Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Open a bash in local docker instance aka. "ssh into local docker instance"
#!/bin/bash -xe
# docker id might be given as a parameter
if [[ "$DID" == "" ]]; then
# if no id given simply just connect to the first running instance
DID=$(docker ps | grep -Eo "^[0-9a-z]{8,}\b")
docker exec -i -t $DID bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment