CachyOS / CachyOS/docker

Publish v3 + v4 as platform variants

Open
#5 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Dockerfile
Stars
32
Forks
6
PR merge metrics
No merged PRs in 30d

Description

**TL;DR:** Instead of `cachyos/cachyos-v3:latest` it'd be nicer to leverage the standard `--platform linux/amd64/v3` multi-platform image support, given that's the only actual difference for these images.

---

I wasn't aware initially of the additional v3 and v4 variants published. The DockerHub page has very little context, similar to the README (effectively empty) and description of this repo (_links to the `x86-64` / v1 image only_).

One would need to check this repo contents, or visit the [CachyOS user DockerHub page](https://hub.docker.com/u/cachyos) to notice the v3/v4 images? (_I didn't see any reference on the [wiki](https://wiki.cachyos.org/cachyos_basic/download/) either_)

So I ended up following the wiki for optimized repos 😅 (_I had tried to pull via `--platform` but that suggested no such images were published_). Later found this repo, the approach can be simplified easily enough.

---

Perhaps it's a bit late now that you've already got images published for platforms as separate images at the registry, rather than as multi-platform images that leverage the same tag, but if you're open to changing from that, here's what that'd look like.

```bash
# Current:
docker pull cachyos/cachyos-v3

# Proposed:
docker pull --platform linux/amd64/v3 cachyos/cachyos
```

```console
# NOTE: Variant would be v3 or v4 when that was pulled instead
$ docker inspect cachyos/cachyos | jq '.[] | {Os, Architecture, Variant}'
{
"Os": "linux",
"Architecture": "amd64",
"Variant": null
}
```

This would enable building custom images that reference `cachyos/cachyos` with the desired platform variant without having to likewise adopt the same non-DRY approach as CachyOS has taken.

If a specific platform is needed, that can be done via `FROM --platform=linux/amd64/v3 AS my-base-v3` for example. It'd otherwise use the default platform of the builder, or could be set at build time via `--platform` instead of relying on non-standard means.

## Dockerfile

Adapted from [current `Dockerfile`](https://github.com/CachyOS/docker/blob/2f032fd8df222c4ec670597df346fafaa9da8055/Dockerfile). Removing the need for separate `Dockerfile`s for v3 and v4 variants.

```Dockerfile
FROM archlinux:base-devel AS rootfs
RUN <

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.