############################################################################### # Helpful Docker commands to create, start, and stop containers ############################################################################### # install docker first using directions for installing latest version # https://docs.docker.com/installation/ubuntulinux/#ubuntu-trusty-1404-lts-64-bit # create new docker ubuntu container sudo docker pull ubuntu # 1x pull down image ahead of time sudo docker run -i -t ubuntu /bin/bash # drops you into container as root # list images and containers sudo docker images # all images sudo docker ps -a # all containers # start and attach to container sudo docker start sudo docker attach # stop and remove container sudo docker stop sudo docker rm #stop and remove ALL containers docker stop $(docker ps -a -q) docker rm $(docker ps -a -q) sudo docker rm $(sudo docker ps --before="" -q) # can also filter # remove image (remove assoc. containers first) # sudo docker rmi # other great tips: http://www.centurylinklabs.com/15-quick-docker-tips/