mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-26 07:40:07 +00:00
Merge pull request #3988 from UserTaken/docker_update
Docker run and create options
This commit is contained in:
commit
6a340d99fd
1 changed files with 75 additions and 14 deletions
|
@ -36,7 +36,7 @@ __docker_images() {
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
__attach() {
|
__attach() {
|
||||||
_arguments \
|
_arguments \
|
||||||
'--no-stdin[Do not attach stdin]' \
|
'--no-stdin[Do not attach STDIN]' \
|
||||||
'--sig-proxy[Proxify all received signal to the process (even in non-tty mode)]'
|
'--sig-proxy[Proxify all received signal to the process (even in non-tty mode)]'
|
||||||
__docker_containers
|
__docker_containers
|
||||||
}
|
}
|
||||||
|
@ -52,16 +52,59 @@ __build() {
|
||||||
|
|
||||||
__commit() {
|
__commit() {
|
||||||
_arguments \
|
_arguments \
|
||||||
'(-a,--author=)'{-a,--author=}'[Author (eg. "John Hannibal Smith <hannibal@a-team.com>"]' \
|
'(-a,--author=)'{-a,--author=}'[Author (e.g. "John Hannibal Smith <hannibal@a-team.com>")]' \
|
||||||
|
'(-c,--change=)'{-c,--change=}'[Apply Dockerfile instruction to the created image]' \
|
||||||
'(-m,--message=)'{-m,--message=}'[Commit message]' \
|
'(-m,--message=)'{-m,--message=}'[Commit message]' \
|
||||||
'--run=[Config automatically applied when the image is run.]'
|
'(-p,--pause=)'{-p,--pause=}'[Pause container during commit]' \
|
||||||
__docker_containers
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__cp() {
|
__cp() {
|
||||||
__docker_containers
|
__docker_containers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__create() {
|
||||||
|
_arguments \
|
||||||
|
'(-P,--publish-all=)'{-P,--publish-all=}'[Publish all exposed ports to the host interfaces]' \
|
||||||
|
'(-a,--attach=)'{-a,--attach=}'[Attach to STDIN, STDOUT or STDERR]' \
|
||||||
|
'--add-host=[Add a custom host-to-IP mapping]' \
|
||||||
|
'--cap-add=[Add Linux capabilities]' \
|
||||||
|
'--cap-drop=[Drop Linux capabilities]' \
|
||||||
|
'--cpuset-cpus=[CPUs in which to allow execution (0-3, 0,1)]' \
|
||||||
|
'(-c,--cpu-shares=)'{-c,--cpu-shares=}'[CPU shares (relative weight)]' \
|
||||||
|
'--cidfile=[Write the container ID to the file]' \
|
||||||
|
'--device=[Add a host device to the container]' \
|
||||||
|
'--dns=[Set custom dns servers]' \
|
||||||
|
'--dns-search=[Set custom DNS search domains]' \
|
||||||
|
'(-e,--env=)'{-e,--env=}'[Set environment variables]' \
|
||||||
|
'--env-file=[Read in a file of environment variables]' \
|
||||||
|
'--entrypoint=[Overwrite the default entrypoint of the image]' \
|
||||||
|
'--expose=[Expose a port from the container without publishing it to your host]' \
|
||||||
|
'(-h,--hostname=)'{-h,--hostname=}'[Container host name]' \
|
||||||
|
'(-i,--interactive=)'{-i,--interactive=}'[Keep STDIN open even if not attached]' \
|
||||||
|
'--ipc=[IPC namespace to use]' \
|
||||||
|
'(-l,--label=)'{-l,--label=}'[Set meta data on a container]' \
|
||||||
|
'--link=[Add link to another container (name:alias)]' \
|
||||||
|
'--log-driver=[Logging driver for the container]' \
|
||||||
|
'--lxc-conf=[Add custom LXC options]' \
|
||||||
|
'--mac-address=[Container MAC address (e.g. 92:d0:c6:0a:29:33)]' \
|
||||||
|
'(-m,--memory=)'{-m,--memory=}'[Memory limit (format: <number><optional unit>, where unit = b, k, m or g)]' \
|
||||||
|
'--net=[Set the Network mode for the container]' \
|
||||||
|
'--name=[Assign a name to the container]' \
|
||||||
|
'--pid=[PID namespace to use]' \
|
||||||
|
'(-p,--publish=)'{-p,--publish=}'[Publish a container''s port to the host (format: ip:hostPort:containerPort/protocol)]' \
|
||||||
|
'--privileged=[Give extended privileges to this container]' \
|
||||||
|
'--restart=[Restart policy to apply when a container exits]' \
|
||||||
|
'--security-opt=[Security Options]' \
|
||||||
|
'--sig-proxy=[Proxify all received signal to the process (even in non-tty mode)]' \
|
||||||
|
'(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-tty]' \
|
||||||
|
'(-u,--user=)'{-u,--user=}'[Username or UID]' \
|
||||||
|
'--ulimit=[Ulimit options]' \
|
||||||
|
'(-v,--volume=)'{-v,--volume=}'[Bind mount a volume (e.g. -v /host:/container or -v /container)]' \
|
||||||
|
'--volumes-from=[Mount volumes from the specified container(s)]' \
|
||||||
|
'(-w,--workdir=)'{-w,--workdir=}'[Working directory inside the container]'
|
||||||
|
__docker_images
|
||||||
|
}
|
||||||
|
|
||||||
__diff() {
|
__diff() {
|
||||||
__docker_containers
|
__docker_containers
|
||||||
}
|
}
|
||||||
|
@ -180,28 +223,43 @@ __rmi() {
|
||||||
__run() {
|
__run() {
|
||||||
_arguments \
|
_arguments \
|
||||||
'(-P,--publish-all=)'{-P,--publish-all=}'[Publish all exposed ports to the host interfaces]' \
|
'(-P,--publish-all=)'{-P,--publish-all=}'[Publish all exposed ports to the host interfaces]' \
|
||||||
'(-a,--attach=)'{-a,--attach=}'[Attach to stdin, stdout or stderr.]' \
|
'(-a,--attach=)'{-a,--attach=}'[Attach to STDIN, STDOUT or STDERR]' \
|
||||||
'(-c,--cpu-shares=)'{-c,--cpu-shares=}': CPU shares (relative weight)]' \
|
'--add-host=[Add a custom host-to-IP mapping]' \
|
||||||
|
'--cap-add=[Add Linux capabilities]' \
|
||||||
|
'--cap-drop=[Drop Linux capabilities]' \
|
||||||
|
'--cpuset-cpus=[CPUs in which to allow execution (0-3, 0,1)]' \
|
||||||
|
'(-c,--cpu-shares=)'{-c,--cpu-shares=}'[CPU shares (relative weight)]' \
|
||||||
'--cidfile=[Write the container ID to the file]' \
|
'--cidfile=[Write the container ID to the file]' \
|
||||||
'(-d,--detach=)'{-d,--detach=}'[Detached mode: Run container in the background, print new container id]' \
|
'(-d,--detach=)'{-d,--detach=}'[Run container in the background, print new container id]' \
|
||||||
|
'--device=[Add a host device to the container]' \
|
||||||
'--dns=[Set custom dns servers]' \
|
'--dns=[Set custom dns servers]' \
|
||||||
|
'--dns-search=[Set custom DNS search domains]' \
|
||||||
'(-e,--env=)'{-e,--env=}'[Set environment variables]' \
|
'(-e,--env=)'{-e,--env=}'[Set environment variables]' \
|
||||||
|
'--env-file=[Read in a file of environment variables]' \
|
||||||
'--entrypoint=[Overwrite the default entrypoint of the image]' \
|
'--entrypoint=[Overwrite the default entrypoint of the image]' \
|
||||||
'--expose=[Expose a port from the container without publishing it to your host]' \
|
'--expose=[Expose a port from the container without publishing it to your host]' \
|
||||||
'(-h,--hostname=)'{-h,--hostname=}'[Container host name]' \
|
'(-h,--hostname=)'{-h,--hostname=}'[Container host name]' \
|
||||||
'(-i,--interactive=)'{-i,--interactive=}'[Keep stdin open even if not attached]' \
|
'(-i,--interactive=)'{-i,--interactive=}'[Keep STDIN open even if not attached]' \
|
||||||
|
'--ipc=[IPC namespace to use]' \
|
||||||
|
'(-l,--label=)'{-l,--label=}'[Set meta data on a container]' \
|
||||||
'--link=[Add link to another container (name:alias)]' \
|
'--link=[Add link to another container (name:alias)]' \
|
||||||
'--lxc-conf=[Add custom lxc options -lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"]' \
|
'--log-driver=[Logging driver for the container]' \
|
||||||
|
'--lxc-conf=[Add custom LXC options]' \
|
||||||
|
'--mac-address=[Container MAC address (e.g. 92:d0:c6:0a:29:33)]' \
|
||||||
'(-m,--memory=)'{-m,--memory=}'[Memory limit (format: <number><optional unit>, where unit = b, k, m or g)]' \
|
'(-m,--memory=)'{-m,--memory=}'[Memory limit (format: <number><optional unit>, where unit = b, k, m or g)]' \
|
||||||
'(-n,--networking=)'{-n,--networking=}'[Enable networking for this container]' \
|
'--net=[Set the Network mode for the container]' \
|
||||||
'--name=[Assign a name to the container]' \
|
'--name=[Assign a name to the container]' \
|
||||||
'(-p,--publish=)'{-p,--publish=}'[Publish a container''s port to the host (format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort) (use "docker port" to see the actual mapping)]' \
|
'--pid=[PID namespace to use]' \
|
||||||
|
'(-p,--publish=)'{-p,--publish=}'[Publish a container''s port to the host (format: ip:hostPort:containerPort/protocol)]' \
|
||||||
'--privileged=[Give extended privileges to this container]' \
|
'--privileged=[Give extended privileges to this container]' \
|
||||||
|
'--restart=[Restart policy to apply when a container exits]' \
|
||||||
'--rm=[Automatically remove the container when it exits (incompatible with -d)]' \
|
'--rm=[Automatically remove the container when it exits (incompatible with -d)]' \
|
||||||
|
'--security-opt=[Security Options]' \
|
||||||
'--sig-proxy=[Proxify all received signal to the process (even in non-tty mode)]' \
|
'--sig-proxy=[Proxify all received signal to the process (even in non-tty mode)]' \
|
||||||
'(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-tty]' \
|
'(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-tty]' \
|
||||||
'(-u,--user=)'{-u,--user=}'[Username or UID]' \
|
'(-u,--user=)'{-u,--user=}'[Username or UID]' \
|
||||||
'(-v,--volume=)'{-v,--volume=}'[Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)]' \
|
'--ulimit=[Ulimit options]' \
|
||||||
|
'(-v,--volume=)'{-v,--volume=}'[Bind mount a volume (e.g. -v /host:/container or -v /container)]' \
|
||||||
'--volumes-from=[Mount volumes from the specified container(s)]' \
|
'--volumes-from=[Mount volumes from the specified container(s)]' \
|
||||||
'(-w,--workdir=)'{-w,--workdir=}'[Working directory inside the container]'
|
'(-w,--workdir=)'{-w,--workdir=}'[Working directory inside the container]'
|
||||||
__docker_images
|
__docker_images
|
||||||
|
@ -220,8 +278,8 @@ __save() {
|
||||||
|
|
||||||
__start() {
|
__start() {
|
||||||
_arguments \
|
_arguments \
|
||||||
'(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \
|
'(-a,--attach=)'{-a,--attach=}'[Attach container''s STDOUT/STDERR and forward all signals to the process]' \
|
||||||
'(-i,--interactive=)'{-i,--interactive=}'[Attach container''s stdin]'
|
'(-i,--interactive=)'{-i,--interactive=}'[Attach container''s STDIN]'
|
||||||
__docker_all_containers
|
__docker_all_containers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,6 +324,7 @@ _1st_arguments=(
|
||||||
"build":"Build a container from a Dockerfile"
|
"build":"Build a container from a Dockerfile"
|
||||||
"commit":"Create a new image from a container's changes"
|
"commit":"Create a new image from a container's changes"
|
||||||
"cp":"Copy files/folders from the containers filesystem to the host path"
|
"cp":"Copy files/folders from the containers filesystem to the host path"
|
||||||
|
"create":"Create new container without running it"
|
||||||
"diff":"Inspect changes on a container's filesystem"
|
"diff":"Inspect changes on a container's filesystem"
|
||||||
"events":"Get real time events from the server"
|
"events":"Get real time events from the server"
|
||||||
"export":"Stream the contents of a container as a tar archive"
|
"export":"Stream the contents of a container as a tar archive"
|
||||||
|
@ -315,6 +374,8 @@ case "$words[1]" in
|
||||||
__commit ;;
|
__commit ;;
|
||||||
cp)
|
cp)
|
||||||
__cp ;;
|
__cp ;;
|
||||||
|
create)
|
||||||
|
__create ;;
|
||||||
diff)
|
diff)
|
||||||
__diff ;;
|
__diff ;;
|
||||||
events)
|
events)
|
||||||
|
|
Loading…
Reference in a new issue