References

  • http://www.dwmkerr.com/learn-docker-by-building-a-microservice/

Attach shell to Docker

eval $(docker-machine env)

Run

docker run --name=loving_heisenberg -it --rm=true aliok/something

Attach

Shell with user defined in Dockerfile:

sudo docker exec -it loving_heisenberg /bin/bash

shell with root:

sudo docker exec -it -u 0 loving_heisenberg /bin/bash

Remove

Delete all untagged images:

docker rmi $(docker images | grep "^<none>" | awk '{print $3}')

Delete all unused images:

docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
comments powered by Disqus