rockstorm101 / jekyll-docker Goto Github PK
View Code? Open in Web Editor NEWRun Jekyll inside a Docker container
License: GNU General Public License v3.0
Run Jekyll inside a Docker container
License: GNU General Public License v3.0
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"]
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.