Discovering Jekyll

I decided to give a chance to Jekyll after I realized that you can deploy it for free on Github! This is also my first post on this blog, I would report here the procedure I did to start with Jekyll. This will be useful when I will write the second post!

The Jekyll environment

I created a Docker image to recreate the develompent environment every time.
I know, there is already an Offcial Jekyll Docker image but it’s so heavy!
I created a Dockerfile starting from Alpine:

FROM alpine:3.7

LABEL maintainer="marco.bore@gmail.com"


RUN apk add --update curl vim \

    build-base \
    python \
    libxslt-dev libffi-dev \
    ruby-dev ruby-io-console ruby-irb ruby-json ruby-rake \
    && gem install --no-document jekyll bundle

EXPOSE 4000

The last line is the most important:

Build and run the container

When I have more that 3 docker options I usually create a run.sh file.

#!/bin/bash

echo 'Building container...'
docker build -t cnt-jekyll .
docker run -it --rm \

   --name=jekyll \

   -v `pwd`/file:/file \

   -w "/file" \

   -h jekyll \

   cnt-jekyll \

   /bin/sh

The most important parameter is:

Serve Jekyll

bundle install
bundle exec jekyll serve --host 0.0.0.0 

Pleaset notice that if you don’t specify the --host option, you will reach Jekyll just from the container inside.

You can now reach Jekyll typing in the browser jekyll.ip.inthe.dockerbridge:4000

My personal impression

Pro:

Contra: