A variety of command line tools to help with common docker tasks.
These commands require bash on the host, but support containers with bash and/or just sh.
Requires bash.
git clone https://github.com/avirshup/docker-cli-sugar
export PATH=$(pwd)/docker-cli-sugar:${PATH}
# Enable for all your bash sessions:
echo "export PATH=$(pwd)/docker-cli-sugar:${PATH}" >> ~/.bash_profile
Launch a shell in an image or container (whether running or stopped). Launches bash by preference, otherwise sh.
[host]$ docker run -d --name "running-container" alpine sleep 10000
[host]$ dshell running-container
Running 'docker exec -it running-container [...]'
shell: sh
[container]$ apk update # or whatever
[...][host]$ dshell centos
Running "docker run -it --entrypoint=sh centos"
shell: bash
[container]$ yum update # or whatever
[...][host]$ docker run --name "stopped-container" \
alpine sh -c "echo hello world > hello.txt"
[host]$ dshell stopped-container
Container is stopped. Committing to image
Running "docker commit stopped-container dshell-temp-container"
sha256:[...]
Running "docker run --entrypoint=sh -it dshell-temp-container"
[container]$ ls
hello.txt
[container]$ cat hello.txt
hello worldRemove images and/or containers
[host]$ docker run alpine echo hello world --name removeme
[host]$ drm alpine removemeAlias for docker ps
Alias for docker images
Alias for docker stats