Skip to content

[docker] Weekly rebuild of living tags#23352

Open
froozeify wants to merge 4 commits intoglpi-project:11.0/bugfixesfrom
froozeify:11.0/docker-security-rebuild
Open

[docker] Weekly rebuild of living tags#23352
froozeify wants to merge 4 commits intoglpi-project:11.0/bugfixesfrom
froozeify:11.0/docker-security-rebuild

Conversation

@froozeify
Copy link
Member

@froozeify froozeify commented Mar 4, 2026

Rename and update the nightly docker workflow to rebuild the living tags.

Doing this will ensure that the latest images i.e 11.0.6 and 10.0.24 to have security fixes applied.

CVE are often discovered and fixed on the base image, the docker_rebuild script will update the base image (the glpi code downloaded will still be based on the release tag)

Related docker-image PR (should be merged first): glpi-project/docker-images#283

Using actions/github-script making it easy to call github api and also update ci summary <3

We shoudn't need to update anymore this file as it now guess the branch and release name (build is done on the last 2 major release, so currently 10 and 11. Using github release api)

Github don't display the file has being renamed :(

Nightly build (with one with debug enabled)

https://github.com/froozeify/glpi/actions/runs/22710991980
https://github.com/froozeify/glpi/actions/runs/22844220754

image

Living tags build

https://github.com/froozeify/glpi/actions/runs/22710941789
https://github.com/froozeify/glpi/actions/runs/22844248172

image

@froozeify froozeify self-assigned this Mar 4, 2026
@froozeify froozeify force-pushed the 11.0/docker-security-rebuild branch 3 times, most recently from 5549a92 to 47d1946 Compare March 5, 2026 09:49
@froozeify froozeify force-pushed the 11.0/docker-security-rebuild branch from 47d1946 to e180a7b Compare March 5, 2026 11:32
@froozeify
Copy link
Member Author

I just don't recall if for this one i should also make a PR on main and 10.0 or if only in the default branch it will be triggered.

@froozeify froozeify marked this pull request as ready for review March 5, 2026 12:40
@trasher trasher removed their request for review March 5, 2026 13:09
@froozeify froozeify marked this pull request as draft March 5, 2026 13:46
@froozeify froozeify marked this pull request as ready for review March 9, 2026 08:55
@froozeify froozeify requested a review from cedric-anne March 9, 2026 08:55
with:
script: |
const isSecurityRebuild =
context.payload.schedule === '0 3 * * 0' ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not like this check. Indeed, we may want to change the schedule in the future, and if we forgot to change this, we will break scheduled security rebuilds.

IMHO, it would be safer to have a unique schedule, and to have a isSecurityRebuild = context.github.event_name === 'schedule'.

For manual execution, we could have two inputs for manual displatch : "Rebuild nightly images? Yes/No" and "Rebuild latest stable images? Yes/No".

Then we could generate the matrix like this:

const mustRebuildStable =
    context.payload.event_name === 'schedule'
    || context.payload.inputs?.['rebuild-stable'] === 'true';
const mustRebuildNightly =
    context.payload.event_name === 'schedule'
    || context.payload.inputs?.['rebuild-nightly'] === 'true';

if (mustRebuildStable) {
    // push latest stable tags into the matrix (with no-cache: true)
}
if (mustRebuildNightly) {
    // push nighlty builds
}

Comment on lines +53 to +62
const tags = await github.rest.repos.listTags({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100,
});

// Tags are ordered by creation (newest first), only keep stable tags (i.e: 11.0.6, not 11.0.6-rc1)
const stableTags = tags.data
.map(t => t.name)
.filter(name => /^\d+\.\d+\.\d+$/.test(name));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably safer to rely on the releases endpoint and filter to keep only entries matching "draft": false`` and "prerelease": false`.

You can then get the tag_name of each release.

Comment on lines +66 to +67
// Find the first stable tag that begins with the Major.Minor prefix (i.e: 11.0)
const latestVersionTag = stableTags.find(t => t.startsWith(`${supportedVersion}.`));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure tags are correctly sorted at this moment?

return;
}

core.info(`Security rebuild targets: ${latestPerMinorVersion.map(m => m.version).join(', ')}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
core.info(`Security rebuild targets: ${latestPerMinorVersion.map(m => m.version).join(', ')}`);
core.info(`Rebuild targets: ${latestPerMinorVersion.map(m => m.version).join(', ')}`);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants