Jekyll/Github Pages/Docker: Add dependencies

As I told you two days ago, I’m working on this Jekyll page. To generate the thumbnails I needed Imagemagick, but because jekyll doesn’t work on my local mac anymore (don’t ask why – I have no clue) I just found a docker images with does great work – thanks Bret Fisher!

But unfortunaley or thankfully depending on the point of view, the image doesn’t bring imagemagick with it. How to install it?

Temporary

One way is to ssh into the container with

docker exec -it <mycontainer> bash

and then run a command like apt-get install imagemagick, and as you might already guess from the intro, I’m totally into easy, quick solutions, this is even for more too temporary.

The very old way: docker run

In the beginning I did an easy

docker run -p 4000:4000 -v $(pwd):/site bretfisher/jekyll-serve

But it was hard to remember and although I wrote it in a README.md in my repository, I wanted something better, so next step was:

The old way: docker-compose.yml

Then I saw, that Bret offered a docker-compose.yml and started using it, because is something I can remember.

New: docker-compose.yml with Dockerfile

So I learned I can add my own Dockerfile and use it in docker-compose.yml.

services:
  jekyll:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/site
    ports:
      - '4000:4000'

And the Dockerfile is super simple, I only wanted to add imagemagick.

FROM bretfisher/jekyll-serve
RUN apt-get update && apt-get install -y imagemagick

Hope it helps!

One thought on “Jekyll/Github Pages/Docker: Add dependencies

Leave a Reply