Skip to content

Commit

Permalink
Update docker_cli_one_liners.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdalert committed Apr 7, 2016
1 parent 62e79cd commit e534215
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions docker_cli_one_liners.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,12 @@ docker rmi $(docker images | grep centos | awk '{ print $2 }')
# stop and remove all running containers. similar approach due to the consistent API to containers as prior with images. (status=='Up')
docker ps -a | grep Up | awk '{ print $6 }' | xargs docker stop
# upgrade to the latest Mac boot2docker Docker image
boot2docker upgrade
# list the container ip for Mac boot2docker
boot2docker status
#stop and delete running containers
docker ps -l -q | awk '{ print $1 }' | xargs docker stop | awk '{ print $1 }' | xargs docker rm
# start all stopped containers (after a reboot for example)
docker start $(docker ps -qa)
#Attach to a bash shell in the last started container
dockexecl() { docker exec -i -t $(docker ps -l -q) bash ;}
Expand All @@ -169,9 +166,6 @@ docker inspect --format "{{ .NetworkSettings.IPAddress }}" $(docker ps -ql)
#stop and delete a container by name
docker stop <image_name> && docker rm flow_img
# list the container ip for Mac boot2docker
boot2docker ip
# Gracefully stop and delete all container
docker rm $(docker stop $(docker ps -aq))
Expand Down

0 comments on commit e534215

Please sign in to comment.