James Handley's blog on eutony.net

I made a few tweaks to my website over the weekend – chief one being to decrease the static page refresh time and update packages, but ran into all sorts of problems trying to build the Docker image.


Error: Could not load the "sharp" module using the linuxmusl-arm runtime
Possible solutions:
- Manually install libvips >= 8.15.3
- Add experimental WebAssembly-based dependencies:
npm install --cpu=wasm32 sharp
npm install @img/sharp-wasm32
- Consult the installation documentation:
See https://sharp.pixelplumbing.com/install
at Object. (/app/node_modules/sharp/lib/sharp.js:113:9)
at Module._compile (node:internal/modules/cjs/loader:1740:14)
at Object..js (node:internal/modules/cjs/loader:1905:10)
at Module.load (node:internal/modules/cjs/loader:1474:32)
at Function._load (node:internal/modules/cjs/loader:1286:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:234:24)
at Module. (node:internal/modules/cjs/loader:1496:12)
at mod.require (/app/node_modules/next/dist/server/require-hook.js:65:28)
at require (node:internal/modules/helpers:135:16)

> Build failed because of webpack errors

I have had this issue in the past (when I was first moving over to nextjs), but have built the site several times since then, but couldn’t for the life of me remember how to fix it. So I did all the usual stuff to fix it – cleared caches, updated packages… no joy. Builds and runs fine natively on the Pi itself, but the nextjs build fails in Docker with the above error no matter what.

After many hours going down a rabbit hole of node_modules (which I thought was being copied, and causing the issue), it turns out it was all to do with how I was building the container. I had experimented in the past with a fancy cross-platform build (so I could build the Pi container on my Windows PC), which I subsequently abandoned but left the instructions in my Readme.

docker buildx build --platform linux/arm/v7 .

Drop the platform specification, and it builds perfectly.

docker buildx build .

I’m not sure why this is – I know cross platform builds can be… interesting shall we say, but I didn’t think I was doing a cross platform build! Anyway, all working now. (The reason I have the command in my Readme is that I also tag it and push it up to Docker repository).

Incidentally, Stack Overflow was no help – so this is posted in case someone else benefits from my pain!

Sun Jan 05 2025

I am now an investor in cryptocurrency!

Ok, so that’s probably putting it a bit strongly. My younger son really wanted to buy some Dogecoin, so we finally relented and let him spend some of his Christmas money on cypto.

I decided for fun that I would match him in a different currency so we can have a mini competition.

He’s old enough to understand the risk associated – that he may lose all the money, is likely to get back less than he invested, and may not be able to sell it back to pounds when he wants to. Nevertheless he’s seem the 500% growth curve for Doge this year and wants in!

It’s as much about entertainment as anything else – the total amount we’ve spent between us is less than a computer game would cost, and I’m optimistic that they will be worth at least something in a few years time.

So, he has Dogecoin, I have Ether, and I also bought some Sui to make it a 3 horse race. 24 hours in, they are all still worth about what we paid after fees (ETH slightly up, DOGE and SUI slightly down).

Speaking of investment I also bought a modest number of Raspberry Pi shares at the IPO earlier this year. After the initial spike these settled down, but just before Christmas made a huge leap and have stayed up (+133%). I won’t lie and say I’m not tempted to sell, but I bought them to invest in a company I want to back, and plan to keep hold of them long term. It’s essentially part of my pension plan, but nice to see growth.

Back in January 2024 I’d identified some things which we thought were going to change in 2024, and most have come to pass.

  • Bedroom redecorated (which a bonus of fixing squeaky floorboards)
  • Jafar the snake is doing nicely (his “birthday” is the 5th Jan)
  • My car is now fully electric
  • We’ve switched to Zen Internet (referral link) fibre-to-the-home broadband, which has been a fab experience
  • Related to this, we’ve gone fully digital VOIP with our landline
  • I got my Tattoo
  • And I’ve started playing bass guitar (somewhat set back by putting a screwdriver through my finger the day after I bought it)

The real biggy for me was moving away from Virgin Media (they’ve been our Internet, phone, and TV provider since 2000, when it was NTL). I don’t buy into the fibre hype (coax cable, which is what Virgin ran from the cabinet to the router/modem, has plenty enough bandwidth) – but I’d got increasingly dissatisfied with the cost and the internet connectivity issues. Our monthly bill has gone from £59 for 125 MBps (asymmetric) broadband to £38 for 300 MBps symmetric (£32 for Zen, about £6 for VOIP). Not quite like for like, as Virgin included a set-top box, but not with any channels we watched. But in nearly a year we’ve had one short outage I think, but otherwise no degradation of service.

Didn’t manage to knock down our garage or build an extension. I also didn’t digitise any old negatives.

But did tick another thing off my bucket list, which was that we went on a Canal holiday which was also great.

This year? To be honest no big changes planned. We might sort out the garage, and we might start to think a bit more seriously about an extension.

Sat Apr 06 2024

Well, I am now the proud “owner” of a full electric car. I went for a BYD Atto 3 in the end, so I hope the Chinese government doesn’t decide to apply my full emergency brakes while I’m on the M5!

I say “owner” because I’m actually leasing it through work, so it’s technically a company car – but it’s mine in the sense that I’m paying for it and am the one on the insurance.

My venerable (well, 8 yo) Vauxhall has gone the way of motorway.co.uk, so now no petrol for me.

Initial thoughts – I like it, a lot. It’s so quiet and responsive, and now I’ve got the hang of not having to change gears or use the clutch it’s nice. The acceleration is something else, and it’s not even in sports mode.

With the Octopus Go tariff, my annual mileage (~6,000 miles) will cost about £75 – which is roughly the same as a full tank of petrol on the Vauxhall. I was filling up every 4 to 6 weeks probably, so that’s a win in my books. Plus filling up now happens overnight on the drive, not at a petrol station!

The quid pro quo is obviously the range. The theoretical range is 200 miles, but that’s downhill with the wind behind you on a warm day and running the battery completely flat. On a long journey, the distance between stops is more like 120 miles, given that you’re not supposed to run it below 20%, and charging is only fast to 80%. So broadly speaking it’s a 30-60 mins stop for every 2 hours of motorway driving. On my commute to Skipton (31 miles each way, with the A59 being closed) I get down to about 20% after 4 trips, i.e. 120 miles, but it is cold weather.

I guess this is where the rubber hits the road – almost every other aspect of an electric car is an improvement on petrol cars, but if I’m serious about wanting to reduce my environmental impact then actually having to be inconvenienced is when it counts.

Sun Mar 24 2024

We’re going to start having a “movie night” once a week, where we settle down on the sofa and watch a film together. It got me to thinking what we’d actually watch, so I thought I’d compile my ultimate film list.

The criteria are films which really one ought to have seen, and include classics (such as The Great Escape), films which broke new ground (such as The Matrix), films which have made their way into culture (such as ET) and finally films which I think are too good not to have seen (step forward The Princess Bride).

Missing from this list are most 18 rated films – I am excluding all films which are just unpleasant, or you leave feeling dirty and/or psychologically abused (Pulp Fiction, Blair Witch, Baby Driver – and most horror films. You get the drift).

Of course you will disagree – I will include films you wouldn’t agree with (step forward again Princess Bride), and exclude films you would think should be included – plus ca change. I’ll be the first to admit that some of these aren’t that good, but are too nostalgic for me not to include (The Black Hole, amongst others)

I’ve had half a stab at categorising as well – most films straddle categories, but it wouldn’t be me if there wasn’t some attempt at structure!

Musicals

  • Blues Brothers
  • Dirty Dancing
  • Grease
  • Sister Act
  • Annie
  • My Fair Lady
  • Oliver!
  • Little Shop of Horrors
  • Moulin Rouge
  • Singin’ in the Rain
  • The Fiddler on the Roof
  • The King and I
  • Mary Poppins
  • The Sound of Music
  • West Side Story
  • Wizard of Oz
  • Saturday Night Fever
  • Footloose
  • Rocky Horror Picture Show
  • plus Cabaret, Chicago, Guys and Dolls, Oklahama, High Society, ANnnie get your Gun, Calamity Jane, Joseph, Hello Dolly, Thoroughly Modern Millie, Porgy and Bess, Anything Goes, Phantom, South Pacific, Tommy, Carousel, …

Sci-fi / fantasy

  • Alien
  • Aliens
  • Blade Runner
  • Close Encounters of the Third Kind
  • Never ending Story
  • The Matrix
  • Jurassic Park
  • The Terminator 1 & 2
  • Star Wars episodes IV – VI
  • Star Trek (the 2009+ reboots are excellent, but II: Wrath of Khan, IV: Voyage Home, VI: Undiscovered country also all good)
  • The Final Countdown
  • ET: The Extra Terrestrial
  • 2001: A Space Odyssey
  • Jumanji (the 2017+ sequels are really good as well)
  • The Black Hole
  • Avatar
  • Terminator 2
  • Back to the Future
  • Blade Runner
  • Labyrinth
  • The Abyss
  • Electric Dreams
  • War Games
  • Weird Science
  • Predator

Disney / Pixar etc

  • Finding Nemo
  • Toy Story
  • Monsters Inc
  • Lilo and Stitch
  • Frozen
  • The Lady and the Tramp
  • Beauty and the Beast
  • Aladdin
  • The Lion King
  • Finding Nemo

Drama

  • Dead Poets Society
  • Gone with the Wind
  • Romeo and Juliet (Baz Luhrmann)
  • Casablanca
  • American Beauty
  • The Green Mile
  • Edward Scissorhands
  • Ghost
  • The Truman Show
  • The Shawshank Redemption
  • Forrest Gump
  • Good Morning Vietnam
  • Apocalypse Now
  • Amadeus
  • Ben-Hur
  • A Room with a View
  • The Great Escape

Thriller / Action / Adventure

  • The Hunt for Red October
  • The Rear Window
  • Fatal Attraction
  • Lethal Weapon
  • Robocop
  • The Sixth Sense
  • Indiana Jones 1 – 3
  • At least one James Bond
  • Bourne Identity
  • Pyscho
  • Die Hard
  • Gremlins
  • Jaws
  • The Never-ending Story
  • Batman (Michael Keaton)
  • Oceans 11
  • Rocky IV
  • Speed
  • The Goonies
  • The Silence of the Lambs
  • The Karate Kid
  • Mad Max

Comedy / RomCom

  • Romancing the Stone
  • Crocodile Dundee
  • Airplane
  • Roxanne
  • Planes, Trains and Automobiles
  • Sleepless in Seattle
  • Bill and Ted’s Excellent Adventure
  • Wayne’s World
  • Ghostbusters
  • Ferris Bueller’s Day Off
  • When Harry met Sally
  • Beetlejuice
  • Monty Python and the Holy Grail
  • Monty Python and the Life of Brian
  • Nuns on the Run
  • Pirates of the Caribbean
  • Groundhog Day
  • A Muppet Christmas Carol
  • At least 1 Pink Panther film
  • Breakfast at Tiffany’s
  • Some Like It Hot
  • The Cannonball Run
  • The Sting

English Subtitles / Arthouse

  • Amélie
  • Jean de Florette
  • Manon des Sources
  • Cyrano de Bergerac
  • Bend it like Beckham
  • Eternal Sunshine of the Spotless Mind
  • Donnie Darko
  • Being John Malkovich
  • Dogville
  • Lost in Translation
  • Police Story (Jackie Chan)
Fri Jan 26 2024

2004 is shaping up to be a year of change.

We’re not planning any major life changes, but there are quite a few things which have, or will be changing this year:

  • Our boys have swapped bedrooms
  • .. and with that will come a redecoration in due course
  • We now have a pet snake (Jafar)(!)
  • We are replacing our ICE car with an electric one
  • We’re going to switch away from Virgin Media
  • .. and with that to FTTH broadband, and VOIP home phone
  • I’m planning to get a tattoo for the 50th(!!)
  • .. and hopefully taking up bass guitar.
  • We may (finally) knock down our garage, with it’s bulging walls and asbestos roof
  • I’ve ordered a 2nd hand negative scanner, to digitise all my old photos

I recently saw a question on The-Social-Media-Platform-Formerly-Known-As-Twitter asking about how people prepare for preaching a sermon. I wrote a short Twitter-esque reply, but thought it was worth a fuller treatment, in case either anyone is interested, or that it may even be helpful!

TL;DR

  1. Know the context
  2. Marinade in the scripture
  3. Draw up a draft
  4. Practice and refine
  5. Pray and seek God at every stage!

And read these books:

  • “Misreading Scripture with Western Eyes” by Randolph Richards and Brandon O’Brien (IVP 2012)
  • “Short Stories by Jesus: The Enigmatic Parables of a Controversial Rabbi” by Amy-Jill Levine (HarperCollins 2015)
  • “Talk Like TED: The 9 Public Speaking Secrets of the World’s Top Minds” by Carmine Gallo (Macmillan 2014)

Know the context

My first step, as with any talk or presentation, is to establish the context. What sort of service is it? Who will be present? How long should the sermon be? Is there a particular theme? Is the Spirit been on the move in a certain aspect of the church? Is there a “party line” from the church leadership? At what point in the service is the sermon?

Some of these are potentially contentious or controversial, depending on your theology. For example I have a certain ambivalence to thematic preaching, as it’s very easy to squash in a token bible reading to fit what you want to talk about. I also think it assumes a pattern of church attendance (i.e. every week) which doesn’t always match up to the reality.

However I am also a firm believer in operating under authority, especially as an Associate Minister, and I will always seek to publicly back up the vicar/PCC. Of course, this is not blind or unqualified support – particularly thinking about the church’s history on abuse, most recently in the case of Soul Survivor and Mike Pilavachi. It also doesn’t mean being a “yes man”, and in private I will challenge and debate where I think we may be missing the mark. Anyway, I digress.

As some concrete examples, think of how sermon preparation would be different for these contexts:

  • A “normal” Sunday Holy Communion of 5 regular, committed, church members.
  • A “normal” Sunday Holy Communion of 150 regular, committed, church members.
  • A seeker service
  • An early morning service, with a 5 minute homily
  • An evening service, with an hour’s exposition on a bible passage
  • A funeral
  • A family service, with ages from 0 to 100+ present
  • A youth or student worship service
  • A sermon during an act of worship at a theological college
  • A prison
  • A school
  • … and so on

Reflection on the context should help to answer questions around:

  • The length of the sermon
  • The language to use
  • The depth of the content / theological assumptions
  • What level of interactivity
  • What props to use
  • Whether to use a PowerPoint type presentation
  • What form an application or response might take
  • What sort of humour/stories may be appropriate
  • What sort of humour/stories wouldn’t be appropriate

Marinade in the scripture

I try to start to think about the sermon at least two weeks before I’m preaching. I like to read the passage (or identify the theme) and mull it over. I try to come to it with fresh eyes – is there anything I’m skipping over. What are my cultural filters?

At this point I have to recommend a couple of books; “Misreading Scripture with Western Eyes” by Randolph Richards and Brandon O’Brien (IVP 2012), and “Short Stories by Jesus: The Enigmatic Parables of a Controversial Rabbi” by Amy-Jill Levine (HarperCollins 205). The second in particular isn’t very comfortable reading, but both certainly opened my eyes to some of the assumptions I (and our churches) make when reading scripture.

I sometimes do a lectio divino on the passage, to see what the Spirit might want to draw my attention to. Even if I’m not, I try to settle myself, ensure I have some quiet time and space, and just sit with the passage for a while, reading it over and praying through it.

I will sometimes dig out a commentary at this point, and will also reflect on resonances with other parts of the Bible. I will start to muse over whether there’s anything I’ve read which speaks to this passage. I will think about what quotes there might be. Or personal stories from my own life. I also start to keep my ears open for anything I come across which speaks to this passage. The internet has been a God-send for this, as I will often think “H’mm – I read something in Church Times about that”, and I can go and search it up.

As a slight aside, I keep a sermon scrapbook, and whenever I come across something which speaks to me in a newspaper or magazine, I cut it out and stick in the scrapbook. A lot of it I will may never use. My only tip is to make sure that you’ve either included the reference in the cutting, or write it alongside in the scrapbook.

Draw up a draft

This is probably what most people think of as writing a sermon. Turning the thoughts and musings into something ready to speak.

I usually start off with a mind-map, and get my thoughts and musings down on paper. I almost never keep them, so I can’t given an example, but a quick google gives lots of hits: how-mind-mapping-has-rejuvenated-my-sermon-preparation.

At this point I am just downloading ideas and following trains of thought, so see what emerges. I might identify areas I need to do a bit of research, have a look at different translations, read a commentary, maybe even dig into the Greek or Hebrew if I get very excited. Try and identify parallel passages.

The next step for me is to start to shape it, and how I do that depends greatly on the context. If it’s a ‘normal’ Sunday service I usually identify 3 major themes or points, each of which has 3 sub-points. I don’t necessary explicitly identify these when preaching, but I can hold 3×3 elements in my head, so can preach it with minimal notes. I quite like the following quote – I don’t know who said, and it’s far from the whole story, but it’s an interesting thought.

If you can’t keep your sermon in your head, how do you expect other people to?

So this ends up the following structure:

Introduction
A       B       C
A1      B1      C1
A2      B2      C2
A3      B3      C3
Conclusion

This approach/structure comes from one of my favourite books on public speaking, “Talk Like TED: The 9 Public Speaking Secrets of the World’s Top Minds” by Carmine Gallo (Macmillan 2014). Once you get to longer than 10 or 15 minutes this technique runs out of steam a bit.

My notes when I’m using this technique look like this (for a sermon entitled “Jesus is Lord: Over creation – Mark 4:35-41”)

Example of Sermon notes TED style

Another approach I’ve been experimenting with recently is sketchnoting, which is sort of like inverse note taking. This is much more of a journey, and is (obviously) far more visual than either a full script or the TED-like approach.

This ends up looking something like this:
Example of sketchnoted sermon notes

Finally, if I get completely stuck, or is it a service where the language or timing is critical, I do write out the entire script verbatim.

So this is the opening of my sermon for our 2018 Remembrance Day service.

Pour out jug of sand

Never Again.

These were the words spoken one hundred years ago today, as the Armistice was declared, marking the end of the first World War. Of course at the time it wasn’t the first world war – it was The Great War – The War To End All Wars. And Never Again would future generations have to face the horror and pity of war.

Never Again.

And yet, just twenty years later, the world was at war again. Even today, UK armed forces are deployed around the world, and involved in ongoing wars in Iraq and Afghanistan.

Never Again?

In the great war, over 900,000 British soldiers died. Nine Hundred Thousand. That’s about the same number of grains of sand that I poured out when I first came up. Each individual grain of sand representing a British solider who died.

But of course, that’s only British soldiers. 10 million soldiers died in all.

Pour out rest of sand

Practice and refine

By this point I have the essence of the sermon.

What I do now is practice it – I mean literally shut myself in a room and deliver it. Make sure the timing is right. Make sure I know how I’m starting and ending it. Work out exactly how I’m going to tell that story, or assess if that joke is going to work. See if there’s bits which need to be cut or expanded upon. Try and form it into a cohesive whole.

Of course, if you are using a script, this is the editing phase of the script. But if I’m not using a script I rehearse it in my mind often right up to when I actually stand up to preach. Choice of phrase. Pause points. Which bits to repeat for emphasis.

For me, this is very much about the delivery.

In general terms, the longer the sermon the less “tight” it has to be. So if it’s an hour exposition, I will probably not rehearse it the whole way through, but will make sure I know what I’m saying for every verse, and then play it by ear on the day. For a ten minute sermon, I reckon you need to know the exact message and phrasing if you’ve any chance of keeping to time.

Incidentally don’t shy away from ruthless editing. My spiritual director once told me that he writes his sermon on Monday, sets it aside for the week, and then picks it up again on Friday and deletes half the words!

Pray and seek God at every stage!

This should go without saying – but ultimately preaching is huge privilege, and we’re seeking to share God’s heart with the congregation. That is an awesome responsibility, and not to be taken lightly. Throughout my entire sermon prep my dual prayer is “God help me”, and “may these words be your words”.

I hope that it is never my message when I preach, but God’s message through my words. Bishop Helen-Ann Hartley (now Bishop of Newcastle) once prayed this at the start the start of one of her sermons, and it has really stuck me with. It’s from memory, so is almost certainly a paraphrase.

May the written word and my spoken word bring us to you the living Word, Amen.

Fri Jul 28 2023

My son asked this week about what the easiest way to make a flowchart (for a Factorio mod he’s designing!).

I pointed him at Miro, and it made me realise there’s actually quite a few online tools I use a lot at home and work, which are worth a shout-out.

Some of these I may have mentioned previously:

  • miro.com – an awesome online “visual collaboration platform”.
  • Trello – a nice collaborative Kanban type board.
  • Doodle – a collaborate polling system, great for fixing a date for meetings.
  • mentimeter – interactive presentation software, great for adding interactivity.
  • balsamiq.com – not free, but a really good wireframing system for knocking together visual prototypes.
  • heroku.com – speaking of prototypes, heroku lets you knock up functional web app prototypes really quickly.
Thu Jun 29 2023

Just a very quick website update.

When I first migrated to using next.js as my front-end, I used the WPGraphQL plugin to fetch data from WordPress.

GraphQL is really nice – especially the facility to tailor queries and include related data – but on WordPress it seems really slow. Obviously I am running WordPress on massively underpowered hardware, but it was taking 30-40 minutes to statically build the site, and maybe 10+ seconds to return dynamic pages, such as search results.

So, I’ve got rid of WPGraphQL, and am now using the standard REST API (with some extensions). The static build is down to about 10 minutes, and search results are back in ~4 seconds (still slow, but acceptable).

One side effect is that I’ve had to change how the paging works, so it’s a more traditional Page 1 of 10 type approach, which a page navigation at the bottom. New pages load in about 2-3 seconds, which is ok.

I’ve also finally removed my custom theme and related plugins from the back end, which should have also sped things up a bit.

I’m also re-working the categories and tags, as they’re a bit of a mess at the mo, but with 800 odd posts to review it may take a while!

I recently blogged about my e-mail backup strategy, using imap-backup. However I’ve found in real life this tool trips up quite a lot, and doesn’t really sync very satisfactorily on an ongoing basis.

It’s also been slightly nagging at me that I’m just mirroring – so if an e-mail is deleted it’s gone for good once the next backup has run. But equally I didn’t want to have to backup the whole shebang every time.

So, the solution I’ve reached is a combination of offlineimap and my old friend restic to do incremental backups securely and efficiently. The restic repository also goes up to good old sync.com, which is potentially a bit of duplication – but I wanted the snapshot capability (rather than individual file histories).

Basic workflow is

  1. Use offlineimap to mirror the imap server into local maildir folders
  2. Use restic to take a snapshot of the maildir folders

Of course, this is all done using Docker containers. So step one uses a volume within the docker container, step 2 uses a local filesystem mount for the restic repository.

Dockerfile

Pretty standard – install offlineimap and restic, then copy across the config file to ~/.offlineimaprc. Worth saying that ~/.offlineimaprc has passwords in it, so this image shouldn’t be published anywhere!

FROM ubuntu:latest AS build ENV HOME /root SHELL ["/bin/bash", "-c"] RUN apt-get update && apt-get -y --no-install-recommends install \ offlineimap ca-certificates restic RUN update-ca-certificates RUN adduser --system --uid 1000 --home /home/imapuser --shell /bin/bash imapuser RUN mkdir /imap-backup && chown imapuser /imap-backup USER imapuser ENV HOME /home/imapuser WORKDIR /home/imapuser COPY --chown=imapuser offlineimap.conf .offlineimaprc RUN chmod 0600 .offlineimaprc CMD ["offlineimap"]

.offlineimaprc

Best off reading the docs, but this is what I had to do to get it working nicely. Looking at it again now, the windows stuff and nametrans may no longer be required, as I originally used a mounted windows volume rather than a native docker volume for this step.

Of course you can add as many accounts as you want.

[general] accounts = account1,account2 metadata = /imap-backup/meta ui = basic fsync = False [DEFAULT] remotehost = imap.somewhere.com starttls = yes ssl = yes sslcacertfile = OS-DEFAULT expunge = no maildir-windows-compatible = yes nametrans = lambda folder: re.sub('[ \':/]', '_', folder) [Account account1] localrepository = Account1Local remoterepository = Account1Remote [Repository Account1Local] type = Maildir localfolders = /imap-backup/account1_eutony_net [Repository Account1Remote] type = IMAP readonly = True remoteuser = [email protected] remotepass = account1password [Account account2] localrepository = Account2Local remoterepository = Account2Remote [Repository Account2Local] type = Maildir localfolders = /imap-backup/account2_eutony_net [Repository Account2Remote] type = IMAP readonly = True remoteuser = [email protected] remotepass = account2password

Backup.bat

This is slightly more involved. I’ve got the best outcome when I sync each account individually. This script spins up a docker container for each account in turn, with a named volume mount called offlineimap which stores the local maildir (so it persists between runs). Then it spins up a final docker container to do the restic business.

That last line is a bit more involved it has to mount two volumes – the offlineimap as above, but then a Windows folder on my host PC mounted at /restic which stores the restic repository. This Windows folder is one managed by sync.com. As you can see, I needed to add some extra bits and pieces to the restic command to get it to do the incremental backup properly with a mounted windows volume.

docker container run --rm -v "offlineimap:/imap-backup" ^ offlineimap offlineimap -q -a account1 docker container run --rm -v "offlineimap:/imap-backup" ^ offlineimap offlineimap -q -a account2 docker container run -e RESTIC_PASSWORD=****** --rm -v "offlineimap:/imap-backup" ^ -v "C:/Users/james/Backups/email/offlineimap/restic:/restic" ^ offlineimap restic --ignore-inode --cache-dir=/imap-backup/.cache ^ --host=offlineimap -r /restic backup /imap-backup

In action

The first run is slow, as it has to download entire mailboxes, but thereafter it’s only a few seconds per account.

The abridged log output is shown below. The numbers won’t add up as this is from one of my actual runs, which syncs 6 or 7 e-mail accounts.

OfflineIMAP 8.0.0 Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception) imaplib2 v3.05, Python v3.10.6, OpenSSL 3.0.2 15 Mar 2022 *** Processing account account1 Establishing connection to imap.somewhere.com:993 (Account1Remote) Syncing Drafts: IMAP -> Maildir Skipping Drafts (not changed) Syncing Sent Items: IMAP -> Maildir Skipping Sent Items (not changed) Syncing Spam: IMAP -> Maildir Skipping Spam (not changed) Syncing INBOX: IMAP -> Maildir Copy message UID xxxx (1/2) Account1Remote:INBOX ->Account1Local:INBOX Copy message UID xxxx (2/2) Account1Remote:INBOX ->Account1Local:INBOX *** Finished account 'account1' in 0:06 OfflineIMAP 8.0.0 Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception) imaplib2 v3.05, Python v3.10.6, OpenSSL 3.0.2 15 Mar 2022 *** Processing account account2 [...] *** Finished account 'account1' in 0:01 using parent snapshot 25d4e6dd Files: 68 new, 9 changed, 39759 unmodified Dirs: 0 new, 49 changed, 1464 unmodified Added to the repo: 5.871 MiB processed 39836 files, 3.893 GiB in 0:02 snapshot ebd8f443 saved