Sign inSign up

anshuldevops/jekyll-serve

By anshuldevops

•Updated over 8 years ago

Jekyll in a Docker Container For Easy SSG Development

Image
1

282

anshuldevops/jekyll-serve repository overview

jekyll in a Docker Container But this has been done. Why not docker pull jekyll/jekyll?

I wanted defaults to be jekyll serve when container is run, which I use 90% of time I wanted to dev on a local jekyll site w/o having jekyll installed on my host OS I wanted it to be as easy as possible to start I wanted current alpine, ruby, and jekyll So, this does that.

Getting Started Assuming Docker and Docker Compose are installed:

cd dir/of/your/jekyll/site docker run -p 80:4000 -v $(pwd):/site anshuldevops/jekyll-serve That's it!

Details: it will mount your current path into the containers /site, bundle install before running jekyll serve to , serve it at http://localhost⁠.

To make this even easier, copy docker-compose.yml from this repo to your jekyll site root. Then you'll only need to:

cd dir/of/your/jekyll/site docker-compose up Q&A Q. What if I need to create a site first?

just add a environment variable to the run command to tell the container to make one:

docker run -p 80:4000 -v $(pwd):/site -e JEKYLL_NEW=true anshuldevops/jekyll-serve Q. What if I want to run other jekyll commands?

just add the command to the end (with your -v included) to override the jekyll serve:

docker run -v $(pwd):/site anshuldevops/jekyll-serve jekyll doctor

Tag summary

Content type

Image

Digest

Size

87 MB

Last updated

over 8 years ago

docker pull anshuldevops/jekyll-serve