From e534215640aeab386ee49bce5a0edca63d07fbbb Mon Sep 17 00:00:00 2001 From: Brent Salisbury Date: Thu, 7 Apr 2016 02:48:04 -0400 Subject: [PATCH] Update docker_cli_one_liners.sh --- docker_cli_one_liners.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/docker_cli_one_liners.sh b/docker_cli_one_liners.sh index 7924adf..b1db807 100644 --- a/docker_cli_one_liners.sh +++ b/docker_cli_one_liners.sh @@ -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 ;} @@ -169,9 +166,6 @@ docker inspect --format "{{ .NetworkSettings.IPAddress }}" $(docker ps -ql) #stop and delete a container by name docker stop && 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))