Create a docker container for Jekyll blog site
by Wenwei Weng
I haven’t updated my blog for various reasons, one of them is due to my laptop changed including while I was at Cisco and then moved to Palao Alto networks. Jekyll is a very nice framework for blog site. However setting up the development eviroment is not trial while all things are moving include ubuntu OS, ruby version, gem version, jekyll version, plus github, plus I was doing it using a VM running inside VirtualBox. It is not a pleasant expereince every time when I changed my laptop even though I did back up my VM. Mostly it stopped work. This time, I decided to make my bog development into Docker container. To share with others and also remind my self in the future, here are details:
- Step#1 install docker follow steps here: https://docs.docker.com/engine/install/ubuntu/
- step#2: docker pull ubuntu:20.04
- step#3: run docker ubuntu
- step#4: install ruby version 2.7.2 thru rvm inside container https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rvm-on-ubuntu-20-04 step#5: install jekyll
- step#6 find a jekyll theme to use https://jekyllthemes.io/free
- step#7 install required gems for jekyll to run Make sure the generated blog site is working.
-
step#8 Customize your blog site
Clean up all sample dummy posts under "_posts" directory, change "about.mk" etc...
- Editing _config.yml for your blog site title.
- Create blog post under "_posts" using markdown
- Rebuild blog site: bundle exec jekyll server -H 172.17.0.3
- The site pages are created under directory "_site", which should be copied to deployment site. In my case, I created github repo "weweng.github.io", and upload over there.
Subscribe via RSS