Mount your jekyll site folder (the one containing Gemfile) into /site and (optionally) mount a cache directory to /usr/local/bundle for caching gems, and pass your bundle command to the container:
docker run --rm -v $(pwd):/site -v $(pwd)/.cache:/usr/local/bundle sievelau/jekyll:cli bundle exec jekyll build
For starting a live server for preview, use the server tag:
docker run --rm -p 4000:4000 -v $(pwd):/site -v $(pwd)/.cache:/usr/local/bundle sievelau/jekyll:server
The image works on /site. The container will search for the Gemfile in the /site folder and:
bundle install to prepare the dependencies.gem install jekyll to make jekyll command available (so you can init a new jekyll site).After that, the cli tag variant will run the command you gave while the server variant will start a jekyll live server on port 4000.
Basically, the two tags are the same, except that the server tag will execute the command to start the jekyll local server by default, while the cli will not do anything meaningful.
Content type
Image
Digest
sha256:9ee01ac8a…
Size
217.7 MB
Last updated
almost 3 years ago
docker pull sievelau/jekyll:fat