Sign inSign up

cjimti/jekyll

By cjimti

Updated over 8 years ago

Github Pages - Development Docker Container for Jekyll Sites

Image
1

1.3K

cjimti/jekyll repository overview

Github Pages - Development Docker Container

see: https://github.com/cjimti/ghp-dev

Docker Container Image Size Docker Container Layers Docker Container Pulls

Github Pages, local Jekyll site development with Docker

No need to install Ruby, rvm, bundler, etc. The only requirement is Docker.

Fork and build your own Jekyll container or use the the docker-compose configuration below:

Configure

docker-compose.yml:

# Run jekyll build and serve from a Docker container
# for easy local development of a Github Pages Jekyll site.
version: '3'
services:
  build:
    image: "cjimti/jekyll"
    container_name: jekyll-build
    volumes:
      - .:/src
    working_dir: /src
    command:
      - "build"
      - "--watch"
  serve:
    image: "cjimti/jekyll"
    container_name: jekyll-serve
    ports:
     - "4000:4000"
    volumes:
      - .:/src
    depends_on:
      - build
    working_dir: /src/_site
    command:
      - "serve"
      - "--incremental"
      - "-H"
      - "0.0.0.0"   
Run

Run docker-compose up from a terminal in the base of the repository.

Browse to http://127.0.0.1:4000

Run without compose

Build your site once with the following command:

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

Serve your static site and watch for changes:

docker run --rm -v "$(pwd)":/src -w /src -p 4000:4000 \
      cjimti/jekyll serve --incremental -H 0.0.0.0

Browse to http://127.0.0.1:4000

Tag summary

Content type

Image

Digest

Size

91.1 MB

Last updated

over 8 years ago

docker pull cjimti/jekyll