Skip to content

Instantly share code, notes, and snippets.

@trydofor
Created March 27, 2019 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trydofor/036106b44abf8aae620e9c648110ab2b to your computer and use it in GitHub Desktop.
Save trydofor/036106b44abf8aae620e9c648110ab2b to your computer and use it in GitHub Desktop.
通过docker运行jekyll,以免搞乱系统 #docker #shell #blog
#!/bin/bash
# https://hub.docker.com/r/bretfisher/jekyll-serve
path = $(pwd)
name = $(basename $path)
echo visit http://0.0.0.0:4000
docker ps - a | grep $name
case "$1" in
init)
echo $name creating...
docker run \
--name $name \
-it \
-p 4000: 4000 \
-v $path: /site \
bretfisher / jekyll - serve \
bundle exec \
jekyll serve - incremental--watch--force_polling - H 0.0.0.0 - P 4000
;;
start)
docker start $name
;;
stop)
docker stop $name
;;
*) echo "init|stop|start"
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment