BLOG

Verba volant, scripta manent.

Spoken words fly away, written words remain

Run Your Blog on Octopress Framework on MacOS by Using Docker

| Comments

You are running your blog on Octopress framework. You have trouble to make it work after each major OS update because of dependencies hell. The solution is to use Docker image.

Context

I started to use Octopress in 2016. At that time everything worked like a charm. In 2024 the Octopress is no longer supported as I see in https://github.com/octopress/octopress (last commit was 9 years ago). And after each major OS update (I run MacOS) I have troubles with octopress installation, mainly because of ruby and system dependencies updates.

❗Everything was tested on MacOS Sequoia (15.1.1 )

Problem

Obviously, we need to use a Docker.

⚠️But I could not make work the official docker octopress image https://hub.docker.com/r/octopress/octopress

Solution

I crafted specific Docker image to save my work and hours of fixing annoying dependency problems. I hope this work will be useful for other people as well.

You just need to run this command from your octopress root directory in your favourite terminal:

1
docker run -v $(pwd):/srv -p 4000:4000 -it yevgune/octopress_ruby:5 bundle exec jekyll serve --host=0.0.0.0 

Now you can go to your host system, open your favourite browser at http://localhost:4000 and you will get the Octopress running locally. You change the post/page and octopress wrapped by Docker will regenerate the site. That is it. 🥳

Publishing with Rsync 🔄

I’m using the rsync method to deploy site on remote server (go prod). And there is some 🧙 magic parameters for Docker to securely forward your ssh-agent socket to container

1
docker run --rm  -v $(pwd):/srv -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK="/run/host-services/ssh-auth.sock"   -p 4000:4000   -it yevgune/octopress_ruby:5

and once in container, you can run the rsync :

1
bundle exec rake rsync

Comments