ruff/docs
samypr100 7dbd8f0f8e
ci(docker): incorporate docker release enhancements from uv (#13274)
## Summary

This PR updates `ruff` to match `uv` updated [docker releases
approach](https://github.com/astral-sh/uv/blob/main/.github/workflows/build-docker.yml).
It's a combined PR with changes from these PR's
* https://github.com/astral-sh/uv/pull/6053
* https://github.com/astral-sh/uv/pull/6556
* https://github.com/astral-sh/uv/pull/6734
* https://github.com/astral-sh/uv/pull/7568

Summary of changes / features

1. This change would publish an additional tags that includes only
`major.minor`.

    For a release with `x.y.z`, this would publish the tags:

    * ghcr.io/astral-sh/ruff:latest
    * ghcr.io/astral-sh/ruff:x.y.z
    * ghcr.io/astral-sh/ruff:x.y

2. Parallelizes multi-platform builds using multiple workers (hence the
new docker-build / docker-publish jobs), which cuts docker releases time
in half.

3. This PR introduces additional images with the ruff binaries from
scratch for both amd64/arm64 and makes the mapping easy to configure by
generating the Dockerfile on the fly. This approach focuses on
minimizing CI time by taking advantage of dedicating a worker per
mapping (20-30s~ per job). For example, on release `x.y.z`, this will
publish the following image tags with format
`ghcr.io/astral-sh/ruff:{tag}` with manifests for both amd64/arm64. This
also include `x.y` tags for each respective additional tag. Note, this
version does not include the python based images, unlike `uv`.

* From **scratch**: `latest`, `x.y.z`, `x.y` (currently being published)
* From **alpine:3.20**: `alpine`, `alpine3.20`, `x.y.z-alpine`,
`x.y.z-alpine3.20`
* From **debian:bookworm-slim**: `debian-slim`, `bookworm-slim`,
`x.y.z-debian-slim`, `x.y.z-bookworm-slim`
* From **buildpack-deps:bookworm**: `debian`, `bookworm`,
`x.y.z-debian`, `x.y.z-bookworm`

4. This PR also fixes `org.opencontainers.image.version` for all tags
(including the one from `scratch`) to contain the right release version
instead of branch name `main` (current behavior).

    ```
> docker inspect ghcr.io/astral-sh/ruff:0.6.4 | jq -r
'.[0].Config.Labels'
    {
      ...
      "org.opencontainers.image.version": "main"
    }
    ```

Closes https://github.com/astral-sh/ruff/issues/13481

## Test Plan

Approach mimics `uv` with almost no changes so risk is low but I still
tested the full workflow.

* I have a working CI release pipeline on my fork run
1096665773
* The resulting images were published to
https://github.com/samypr100/ruff/pkgs/container/ruff
2024-10-22 07:06:49 -05:00
..
.overrides Use | for page separator in meta titles (#13221) 2024-09-03 00:46:15 +00:00
assets Point docs to Astral favicon (#13219) 2024-09-02 20:11:39 -04:00
editors Update setup image for PyCharm External Tool (#13767) 2024-10-16 04:41:37 +00:00
formatter Fix tuple expansion example in formatter compatibility document (#13313) 2024-09-10 17:47:12 +00:00
js Improvements to documentation (#12712) 2024-08-12 07:17:32 +00:00
stylesheets Use anchorlinks rather than permalinks (#13471) 2024-09-23 02:44:45 +00:00
.gitignore Add docs for Ruff language server (#12344) 2024-07-18 17:41:43 +05:30
configuration.md Remove output-format=text setting (#12836) 2024-10-17 16:35:12 +01:00
faq.md Update faq.md to highlight changes to src (#13145) 2024-08-29 11:57:53 +00:00
formatter.md docs: Lint -> Format in formatter.md (#10777) 2024-04-04 16:50:55 +00:00
installation.md Improvements to documentation (#12712) 2024-08-12 07:17:32 +00:00
integrations.md ci(docker): incorporate docker release enhancements from uv (#13274) 2024-10-22 07:06:49 -05:00
linter.md Improvements to documentation (#12712) 2024-08-12 07:17:32 +00:00
preview.md Spellcheck & grammar (#10375) 2024-03-13 02:34:23 +00:00
requirements-insiders.txt Update dependency ruff to v0.7.0 (#13847) 2024-10-21 01:48:00 +00:00
requirements.txt Update dependency ruff to v0.7.0 (#13847) 2024-10-21 01:48:00 +00:00
tutorial.md Improvements to documentation (#12712) 2024-08-12 07:17:32 +00:00
versioning.md Update versioning policy for editor integration (#12375) 2024-07-18 15:17:36 +00:00