Code Monkey home page Code Monkey logo

docker-jekyll's Introduction

Simple Docker Container for Jekyll Work

Docker Hub: https://registry.hub.docker.com/u/grahamc/jekyll/

Use example:

sudo docker run --rm -v "$PWD:/src" grahamc/jekyll build

or for repeated calls:

alias jekyll='sudo docker run --rm -v "$PWD:/src" -p 4000:4000 grahamc/jekyll'
jekyll build
jekyll serve -H 0.0.0.0

run as a background daemon:

sudo docker run -d -v "$PWD:/src" -p 4000:4000 grahamc/jekyll serve -H 0.0.0.0

Goodies

  • Supports pygments syntax highlighting
  • Supports Github Pages
  • Supports Jekyll Redirect From
  • Supports Kramdown
  • Supports RDiscount
  • Supports Rouge

License: Public Domain

Do what you want!

docker-jekyll's People

Contributors

grahamc avatar josephpage avatar mchelen avatar thachmai avatar tmszdmsk avatar yorkshirekev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-jekyll's Issues

Attempts to use cause "Your bundle is locked to public_suffix (2.0.3)"

I'm a noob when it comes to jekyll and even gems.

Basically any use of this container is complaining about "public_suffix", see below.

> docker run --rm -v "$PWD:/src" -p 4000:4000 grahamc/jekyll new blog
/usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.13.6/lib/bundler/definition.rb:179:in `rescue in specs': Your bundle is locked to public_suffix (2.0.3), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of public_suffix (2.0.3) has removed it. You'll need to update your bundle to a different version of public_suffix (2.0.3) that hasn't been removed in order to install. (Bundler::GemNotFound)
	from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.13.6/lib/bundler/definition.rb:173:in `specs'
	from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.13.6/lib/bundler/definition.rb:233:in `specs_for'
	from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.13.6/lib/bundler/definition.rb:222:in `requested_specs'
	from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:118:in `block in definition_method'
	from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:19:in `setup'
	from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.13.6/lib/bundler.rb:99:in `setup'
	from /usr/local/bundle/gems/jekyll-3.3.0/lib/jekyll/plugin_manager.rb:36:in `require_from_bundler'
	from /usr/local/bundle/gems/jekyll-3.3.0/exe/jekyll:9:in `<top (required)>'
	from /usr/local/bundle/bin/jekyll:22:in `load'
	from /usr/local/bundle/bin/jekyll:22:in `<main>'

Is there a workaround for this with the current grahamc/jekyll image ?

Would rebuilding the image solve the problem ?

Skip install of gem docs?

I was wondering if we should include the --no-rdoc --no-ri flags when installing gems. They slow down the build and add size to the image. Anyone running Jekyll in a container is probably not reading any of the docs from within the container.
Does anyone think the docs should still be installed, in case someone needs them?

Proposal: Create a web-oriented variant

we use this image to directly serve pages to the web. however we need to apply some changes to make it listen to port 80.

i suggest to add an image with :web-tag that includes these changes. if you approve, i will provide a patch.

Gem dependency failure

It seems like some recent gem updates have been causing errors between jekyll and mercenary versions. I'm not exactly sure what the problem is, but found these issues: 1 and 2

My docker logs jekyll_container output looked like:

/usr/local/bundle/gems/jekyll-2.5.3/bin/jekyll:21:in `block in <top (required)>': cannot load such file -- jekyll/version (LoadError)
    from /usr/local/bundle/gems/mercenary-0.3.5/lib/mercenary.rb:18:in `program'
    from /usr/local/bundle/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
    from /usr/local/bundle/bin/jekyll:23:in `load'
    from /usr/local/bundle/bin/jekyll:23:in `<main>'

The tickets I found all suggest using bundle exec jekyll command as a fix. I'll submit a PR with this change to the entrypoint shortly.

Jekyll 2.5 default host is not compatible with docker when serving

In Jekyll 2.5, default host is now 127.0.0.1

Changelog
Use 127.0.0.1 as default host instead of 0.0.0.0 (#3053)

This host won't work with the current docker. The launch command need to be updated to the following:

sudo docker run -d --rm -v "$PWD:/src" -p 4000:4000 grahamc/jekyll serve -H 0.0.0.0

cannot connect when starting with `serve` command

when jekyll is run using only the serve command there does not seem to be a port mapped

i had to use an explicit option like -p 4000:4000 to be able to connect to the server

it makes sense not to map a port when using only build command but if running serve this seems to be required

Quotation mark alternative

The suggested command:

sudo docker run --rm -v "$(pwd):/src" grahamc/jekyll build

works fine, but in a bash shell the command also works like this:

sudo docker run --rm -v $PWD:/src grahamc/jekyll build

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.