Merge pull request #93 from kherrick/update-readme.md

update README.md
This commit is contained in:
Will Sargent 2016-05-17 09:13:43 -07:00
commit 506cc94899

View file

@ -478,25 +478,25 @@ Sources:
``` ```
alias dl='docker ps -l -q' alias dl='docker ps -l -q'
docker run ubuntu echo hello world docker run ubuntu echo hello world
docker commit `dl` helloworld docker commit $(dl) helloworld
``` ```
### Commit with command (needs Dockerfile) ### Commit with command (needs Dockerfile)
``` ```
docker commit -run='{"Cmd":["postgres", "-too -many -opts"]}' `dl` postgres docker commit -run='{"Cmd":["postgres", "-too -many -opts"]}' $(dl) postgres
``` ```
### Get IP address ### Get IP address
``` ```
docker inspect `dl` | grep IPAddress | cut -d '"' -f 4 docker inspect $(dl) | grep IPAddress | cut -d '"' -f 4
``` ```
or install [jq](https://stedolan.github.io/jq/): or install [jq](https://stedolan.github.io/jq/):
``` ```
docker inspect `dl` | jq -r '.[0].NetworkSettings.IPAddress' docker inspect $(dl) | jq -r '.[0].NetworkSettings.IPAddress'
``` ```
or using a [go template](https://docs.docker.com/reference/commandline/inspect) or using a [go template](https://docs.docker.com/reference/commandline/inspect)
@ -514,7 +514,7 @@ docker inspect -f '{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(in
### Find containers by regular expression ### Find containers by regular expression
``` ```
for i in $(docker ps -a | grep "REGEXP_PATTERN" | cut -f1 -d" "); do echo $i; done` for i in $(docker ps -a | grep "REGEXP_PATTERN" | cut -f1 -d" "); do echo $i; done
``` ```
### Get Environment Settings ### Get Environment Settings
@ -538,7 +538,7 @@ docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs docker rm
### Delete stopped containers ### Delete stopped containers
``` ```
docker rm -v `docker ps -a -q -f status=exited` docker rm -v $(docker ps -a -q -f status=exited)
``` ```
### Delete dangling images ### Delete dangling images