oh-my-zsh/plugins/docker-common/_docker-common
2017-01-31 10:32:23 -03:00

17 lines
501 B
Plaintext

dserve() {
local container=dserve${$(pwd)//\//-}
(docker restart $container \
|| docker run -d --name $container -P -v "$(pwd):/usr/share/nginx/html:ro" nginx:stable-alpine) \
&& docker port $container
}
doc() {
# TODO: add zsh conf
# bind shell so we can change current dir (cd, etc)
docker run -it --rm -v "$HOME:/root" -v "/:/all" mhoush/zsh zsh -c "cd /all$(pwd) && $*"
}
sdoc() {
docker run -it --rm -v "$HOME:/root" -v "/:/all:ro" mhoush/zsh zsh -c "cd /all$(pwd) && $*"
}