Giter VIP home page Giter VIP logo

jekyll-docker's People

Contributors

rockstorm101 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dwgibbons

jekyll-docker's Issues

Cannot connect to Jekyll running in docker with default _config.yml

With the default config that Jekyll provides from jekyll build, webrick binds to 127.0.0.1:4000, and hence says Server address: http://127.0.0.1:4000/ in the log when it is run with jekyll serve. This is fine when running Jekyll natively on the host and connecting to it from a browser on the same host.

With Jekyll inside a container and 127.0.0.1 being the loopback interface, it is only accessible from within the container. A browser running on the Docker host makes no connection. If you try to connect from curl you get curl: (56) Recv failure: Connection reset by peer. After much messing around with the EXPOSE 4000 statement in the Docker file I ran a shell in the Jekyll container, installed the iproute2 package and ran ss -ptl which shows:

/srv/jekyll # ss -ptl
State           Recv-Q          Send-Q                    Local Address:Port                     Peer Address:Port          Process
LISTEN          0               128                           127.0.0.1:4000                          0.0.0.0:*              users:(("bundler",pid=1,fd=11))

proving that the Jekyll process is only listening for connections coming via 127.0.0.1, i.e. from within the same container. You can also prove this by running curl localhost:4000 within the container which receives a load of HTML, whereas it does not even connect from the host.

As I see it there are at least two possible fixes. Either add a note in the README.md instructing the user to add an entry host: 0.0.0.0 to their _config.yml after the initial jekyll build, or change the ENTRYPOINT statement in the Dockerfile provided by this repo to ENTRYPOINT ["bundler", "exec", "jekyll", "--host", "0.0.0.0"].

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.