Run Github Pages on Ubuntu on Docker on Windows
Docker has a good usage of container technology, a new virtualization technology that consumes less resource than conventional VMs. In combination with Hyper-V, I believe it will be efficient and convenient enough to be my daily driver for all kinds of developments.
Run Ubuntu a container
docker run -v D:\Projects:/projects --name github-pages -p 127.0.0.1:4000:4000 -it ubuntu bash
Install ruby
sudo apt-get install ruby
Install Bundler
gem install bundler
Install libxml2
sudo apt-get install zlib1g-dev
Install JavaScript runtime
https://github.com/rails/execjs
sudo apt-get install nodejs
Install Github-Pages
Go to Gemfile directory
bundle install
Run Jekyll
jekyll serve --host=0.0.0.0 --watch
For some reason, the above command could not detect directory modifications. So I found an alternative.
jekyll serve --host=0.0.0.0 --force_polling
The container should be up and running. Enjoy developing blogs!