Skip to content

Instantly share code, notes, and snippets.

@raxityo
Created July 13, 2017 01:24
Show Gist options
  • Save raxityo/02021b64e15d51ec11074537a03e0a76 to your computer and use it in GitHub Desktop.
Save raxityo/02021b64e15d51ec11074537a03e0a76 to your computer and use it in GitHub Desktop.
SSH to a docker container by its container_id. Usage: docker-ssh <container_id>.
# !bin/bash
docker-ssh ()
{
if [[ $1 ]]; then
docker exec -it $1 bash
else
echo "Usage: docker-ssh <container_id>"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment