Docker based build on ubuntu-latest?

Does it makes sense to build a Docker image on ubuntu-latest?

Any tips for improvements here please? at 828d707961bc997ab2986e07572a455efcfc1c87 · kaihendry/ · GitHub

Why wouldn’t it make sense?

One thing I notice is that you use an ubuntu base image in the Dockerfile without selecting a specific version. If you don’t care about the version you could just install the tools you need to build on the runner itself, unless there is some external motivation to use Docker (e.g. building somewhere else, too).

It doesn’t make sense because ubuntu-latest IIRC is very bloated image that contains far far more than a slim docker runner.

Are you talking about ubuntu-latest (the GitHub runner VM) or ubuntu:latest (the base image your Dockerfile uses)?

For the VM you’re right that it contains a lot more than just a Docker runner, but if you use GitHub hosted runners there’s no downside to that. If you want to set up a self-hosted runner it might make sense to install only what you actually need.

If you want to speed up the Docker build that’s part of your workflow, it might make sense to use one of the images already cached in the runner VM as the base image.

Not sure which of those images have a good stable version of Docker and are slim.

I think there’s some confusion here. Why are you searching for a Docker image that includes Docker?

I’m looking to replace runs-on: ubuntu-latest with runs-on: really-lightweight-image-with-just-docker if that makes any sense?

Not really, I’m afraid. :sweat_smile: The GitHub hosted runners are standard issue VMs that are automatically created for a job and destroyed after. You only have the choice between different versions of Ubuntu (LTS), Windows, and macOS: Supported runners and hardware resources

The disk image for the VMs comes with a lot of stuff pre-installed, but that doesn’t take any processing resources away from your workflow (or billed time, if you were using a private repo). The only downside to that I’m aware of is that the pre-installed stuff takes up some of the available disk space, I’ve seen some people on this forum discuss what they could delete to make room for workflows that use a lot of disk space.

* except that there may be a couple of services that may be running because of quirks.