Jekyll docker image based on Alpine.
Run Jekyll build
by default, has a watch
mode and support other jekyll commands.
By default the image will run jekyll build
.
The container needs to have 2 volumes :
-
the source directory
-
the output directory
docker run
-v :/var/_source/
-v :/var/_site/
cethy/alpine-jekyll:latest
Example usage with a local directory :
docker run \
-v $PWD/data/source:/var/_source/ \
-v $PWD/data/_site:/var/_site/ \
cethy/alpine-jekyll:latest
docker run -ti \
-v <host source directory>:/var/_source/ \
-v <host output directory>:/var/_site/ \
cethy/alpine-jekyll:latest watch
Note : -ti
in watch mode is required to be able to stop the container w/ ctrl+c
.
docker run -ti cethy/alpine-jekyll:latest <help|new|serve|...> <arg1> <...>
Run help
command or go to the jekyll documentation for more informations.
Note : the env variables (OUTPUT_DIR
, INPUT_DIR
, INPUT_EXTRA_PARAMETERS
) do not impact thoses commands.
docker run \
-v <host source directory>:/var/_source/ \
-v <host output directory>:/var/_site/ \
-e OUTPUT_DIR='/var/_site' \
-e INPUT_DIR='/var/_source' \
-e INPUT_EXTRA_PARAMETERS='' \
cethy/alpine-jekyll:latest
In build
mode, the container will build the site and exit.
In watch
mode, the jekyll script will look for changes in the INPUT_DIR
and rebuild the site each time.
Default | Options |
---|---|
build |
build |watch |
# default
-e OUTPUT_DIR='/var/_site'
Represents the container output directory.
Default | Options |
---|---|
/var/_source |
<any container directory> |
# default
-e INPUT_DIR='/var/_source'
Represents the input directory.
Default | Options |
---|---|
/var/_source |
<any container directory> |
# default
-e INPUT_EXTRA_PARAMETERS=''
Represents the extra parameters you want to send to the jekyll
command.
Default | Options |
---|---|
- | <any acceptable jekyll parameter> |
To add plugins to jekyll, you should :
- clone the repository ;
- edit the Gemfile ;
docker build -t my_alpine-jekyll .
And use your version to build you jekyll websites.
- WIP Jekyll livereload environment cethy/jekyll-livereload