Live data from Hacker News

Cache is King: A guide for Docker layer caching in GitHub Actions

blacksmith.sh

11–20 of 111 posts

Re: Cache is King: A guide for Docker layer caching in GitHub Actions

#14

I've spent days trying all of these solution at my company. All of these solutions suck, they are slow and only successful builds get their layers cached. This is a dead end. The only workable solution is to have a self-hosted runner with a big disk.

how do you ensure isolation between runs on a self hosted runner that way?

Re: Cache is King: A guide for Docker layer caching in GitHub Actions

#15

I've spent days trying all of these solution at my company. All of these solutions suck, they are slow and only successful builds get their layers cached. This is a dead end. The only workable solution is to have a self-hosted runner with a big disk.

how do you ensure isolation between runs on a self hosted runner that way?

What kind of isolation do you need? We are building our own code so I don't see the need for isolation beyond a clear directory.

Re: Cache is King: A guide for Docker layer caching in GitHub Actions

#16

Earlier quoted context omitted.

how do you ensure isolation between runs on a self hosted runner that way?

What kind of isolation do you need? We are building our own code so I don't see the need for isolation beyond a clear directory.

Shared runner infrastructure in a big company. It's pretty common to treat these situations as multi-tenant low trust environments.

Re: Cache is King: A guide for Docker layer caching in GitHub Actions

#17

I've spent days trying all of these solution at my company. All of these solutions suck, they are slow and only successful builds get their layers cached. This is a dead end. The only workable solution is to have a self-hosted runner with a big disk.

how do you ensure isolation between runs on a self hosted runner that way?

Selh-hosted runners can be ephemeral too. With such either mount the cache as a disk or bake docker layers/images into the runner image.

Re: Cache is King: A guide for Docker layer caching in GitHub Actions

#18

I've spent days trying all of these solution at my company. All of these solutions suck, they are slow and only successful builds get their layers cached. This is a dead end. The only workable solution is to have a self-hosted runner with a big disk.

I use namespace’s action runners for this (just a customer, not affiliated in any way). They’re a company with a pretty good product stack. Although the web UI is annoyingly barebones.

Re: Cache is King: A guide for Docker layer caching in GitHub Actions

#19

I've spent days trying all of these solution at my company. All of these solutions suck, they are slow and only successful builds get their layers cached. This is a dead end. The only workable solution is to have a self-hosted runner with a big disk.

how do you ensure isolation between runs on a self hosted runner that way?

If you are in k8s, you can use the default chart provided by GitHub and get 90% of the way there.

Re: Cache is King: A guide for Docker layer caching in GitHub Actions

#20
As someone who spent way too much time chasing this rabbit, the real answer is Just Don't. GitHub Actions is a CI system that makes it easy to get started with simple CI needs but runs into hard problems as soon as you have more advanced needs. Docker caching is one of those advanced needs. If you have non-trivial Docker builds then you simply need on-disk local caching, period.

Either use Depot or switch to self-hosted runners with large disks.

Post reply on HN