Skip to content

Instantly share code, notes, and snippets.

@mattestevens
Forked from mishrsud/docker-commands.sh
Created July 1, 2019 15:52
Show Gist options
  • Save mattestevens/a094e784f2168f913a4ce0b88b94973c to your computer and use it in GitHub Desktop.
Save mattestevens/a094e784f2168f913a4ce0b88b94973c to your computer and use it in GitHub Desktop.
Docker attach execute shell command
# PS: If running Linux containers on Windows, the command shell must be running as admin
# Attach to the default shell of a running container
sudo docker attach 665b4a1e17b6
# Access a shell and run custom commands inside a container
# 665b4a1e17b6 is the ID of the container obtained from docker ps
sudo docker exec -i -t 665b4a1e17b6 /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment