Jekyll/Github Pages/Docker: Add dependencies
Fabian Blechschmidt
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!
Other articles from this category
Shopware 6 Hidden Gems #16: CloneBehavior — entity duplication with overrides, one call
You know the admin’s „duplicate“ button on products. Now the ticket says: „We need that, but from code — duplicate a product per sales channel, with adjusted name and its own product number.“ Or: „Campaign landing pages: clone this CMS page 20 times with different headlines.“ I’ve watched this get implemented as: load entity with […]
Shopware 6 Hidden Gems #15: ChangeSet — before/after values for every write, no second query
The requirement sounds harmless every time: „Log when a product price changes, with old and new value.“ Or: „When an order’s email changes, notify the old address.“ Or the audit-trail classic: „Who changed what, from what, to what?“ And every time, the naive implementation is the same sad shape: subscribe to product.written, load the entity […]
Shopware 6 Hidden Gems #14: WriteProtected & ApiAware — field-level security without a single subscriber
A code review scenario. A plugin adds a purchasePrice-style field to a custom entity — internal margin data. The review question: „Can the Store API read this?“ Followed by: „Can the Admin API write that computed field you recalculate in a subscriber?“ The answers, in the plugin at hand, were „yes“ and „yes, and then […]