diff --git a/plugins/docker/_docker b/plugins/docker/_docker index fd459a0ca..0f2806fce 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -271,20 +271,23 @@ _1st_arguments=( "build":"Build a container from a Dockerfile" "commit":"Create a new image from a container's changes" "cp":"Copy files/folders from the containers filesystem to the host path" + "create":"Create a new container" "diff":"Inspect changes on a container's filesystem" "events":"Get real time events from the server" + "exec":"Run a command in an existing container" "export":"Stream the contents of a container as a tar archive" "history":"Show the history of an image" "images":"List images" "import":"Create a new filesystem image from the contents of a tarball" "info":"Display system-wide information" - "insert":"Insert a file in an image" "inspect":"Return low-level information on a container" "kill":"Kill a running container" "load":"Load an image from a tar archive" "login":"Register or Login to the docker registry server" + "logout":"Log out from a Docker registry server" "logs":"Fetch the logs of a container" "port":"Lookup the public-facing port which is NAT-ed to PRIVATE_PORT" + "pause":"Pause all processes within a container" "ps":"List containers" "pull":"Pull an image or a repository from the docker registry server" "push":"Push an image or a repository to the docker registry server" @@ -299,6 +302,7 @@ _1st_arguments=( "stop":"Stop a running container" "tag":"Tag an image into a repository" "top":"Lookup the running processes of a container" + "unpause":"Unpause a paused container" "version":"Show the docker version information" "wait":"Block until a container stops, then print its exit code" "exec":"Run a task inside a running container" diff --git a/plugins/docker/docker.plugin.zsh b/plugins/docker/docker.plugin.zsh new file mode 100644 index 000000000..8cca680f3 --- /dev/null +++ b/plugins/docker/docker.plugin.zsh @@ -0,0 +1,29 @@ +# Show only the latest created container ID +alias dl="docker ps -l -q" + +# Show all containers +alias ds="docker ps -a" + +# List images +alias dim="docker images" + +# Check IP Address of specific container +alias dip="docker inspect --format=\"{{ .NetworkSettings.IPAddress }}\"" + +# Remove all containers. +drm() { docker rm $(docker ps -q -a); } + +# Stop all containers +dst() { docker stop $(docker ps -q -a); } + +# Kill all running containers. +alias dockerkillall='docker kill $(docker ps -q)' + +# Delete all stopped containers. +alias dockercleanc='printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)' + +# Delete all untagged images. +alias dockercleani='printf "\n>>> Deleting untagged images\n\n" && docker rmi $(docker images -q -f dangling=true)' + +# Delete all stopped containers and untagged images. +alias dockerclean='dockercleanc || true && dockercleani'