Immagine Docker: le emoji restano, Liberation resta fuori (risposta 2)
Risposta di Alberto del 25 novembre 2026: a Chromium le emoji servono per mostrare le pagine del sito nella vista remota (senza, quadratini), mentre Liberation non serve. fonts-noto-color-emoji torna nel Dockerfile con il suo motivo accanto alla lista e una riga nella tabella di docs/docker.md; ambiente-prove.sh lo aveva già dall'unione. ImageContentsTests ammette il pacchetto, vieta ancora Liberation, chiede gli stessi due caratteri all'immagine e alle prove della CI, e vieta ffmpeg al posto della vecchia tolleranza «da togliere con C3». Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bbe4f9c32a
commit
3d234f8791
4 files changed
+27
-27
No files matched your search
@@ -23,25 +23,22 @@ public sealed partial class ImageContentsTests
|
||||
["libgcc-s1"] = ".NET and Chromium",
|
||||
["zlib1g"] = "a direct dependency of Chromium",
|
||||
["fonts-dejavu-core"] = "the first font fontconfig asks for: without a font Chromium draws no text",
|
||||
["fonts-noto-color-emoji"] = "colour emoji: Chromium needs them to show the pages (Alberto, 25 November 2026)",
|
||||
["ca-certificates"] = "certificate authorities for .NET TLS",
|
||||
["tzdata"] = "time zones for the engine and Chromium",
|
||||
["locales"] = "generates it_IT.UTF-8 for the C library Chromium runs with",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Still installed on this line of work and removed by stages C2–C3 (branch funzione/decoder-h264), which also
|
||||
/// remove its lines from the Dockerfile. Tolerated, never required: drop it from here once that branch is merged.
|
||||
/// </summary>
|
||||
private static readonly HashSet<string> PendingRemoval = ["ffmpeg"];
|
||||
|
||||
/// <summary>Without these the image does not work: the browser, its display, and what .NET loads.</summary>
|
||||
private static readonly string[] Required = ["chromium", "chromium-l10n", "xvfb", "libicu76", "libssl3t64", "ca-certificates", "tzdata", "locales"];
|
||||
|
||||
/// <summary>Programs that must not come back: an init of others, privilege tools, downloaders, other runtimes.</summary>
|
||||
private static readonly string[] Forbidden =
|
||||
["tini", "dumb-init", "gosu", "su-exec", "sudo", "curl", "wget", "nodejs", "npm", "python3", "jq",
|
||||
// Fonts for looks only: Chromium does not ask for them (Liberation is a Recommends, the emoji font nothing).
|
||||
"fonts-liberation", "fonts-liberation2", "fonts-noto-color-emoji", "fonts-noto-core", "fonts-noto"];
|
||||
// Videos are read and decoded by Febe's own code since stage C3.
|
||||
"ffmpeg",
|
||||
// Fonts for looks only (Alberto, 25 November 2026: Liberation leaves, only the emoji stay besides DejaVu).
|
||||
"fonts-liberation", "fonts-liberation2", "fonts-noto-core", "fonts-noto"];
|
||||
|
||||
[TestMethod]
|
||||
public void TheImageInstallsOnlyChromiumWhatItNeedsXvfbAndWhatTheDotNetRuntimeNeeds()
|
||||
@@ -50,7 +47,7 @@ public sealed partial class ImageContentsTests
|
||||
Assert.HasCount(installed.Distinct(StringComparer.Ordinal).Count(), installed, "every package once");
|
||||
foreach (var package in installed)
|
||||
{
|
||||
Assert.IsTrue(Allowed.ContainsKey(package) || PendingRemoval.Contains(package), $"pacchetto fuori dall'elenco ammesso: {package}");
|
||||
Assert.IsTrue(Allowed.ContainsKey(package), $"pacchetto fuori dall'elenco ammesso: {package}");
|
||||
}
|
||||
|
||||
foreach (var package in Required)
|
||||
@@ -79,7 +76,7 @@ public sealed partial class ImageContentsTests
|
||||
|
||||
static string[] Fonts(string text) => [.. Regex.Matches(text, @"\bfonts-[a-z0-9-]+").Select(m => m.Value).Distinct().Order(StringComparer.Ordinal)];
|
||||
var image = Fonts(string.Join('\n', InstalledPackages(RuntimeStage())));
|
||||
CollectionAssert.AreEqual(new[] { "fonts-dejavu-core" }, image, "one font, the one fontconfig asks for");
|
||||
CollectionAssert.AreEqual(new[] { "fonts-dejavu-core", "fonts-noto-color-emoji" }, image, "the font fontconfig asks for and the emoji, no other");
|
||||
CollectionAssert.AreEqual(image, Fonts(Code(File.ReadAllText(environment))), "ambiente-prove.sh installs the fonts of the image, no more");
|
||||
}
|
||||
|
||||
@@ -87,7 +84,7 @@ public sealed partial class ImageContentsTests
|
||||
public void EveryInstalledPackageHasItsReasonNextToTheList()
|
||||
{
|
||||
var stage = RuntimeStage();
|
||||
var installed = InstalledPackages(stage).Where(p => !PendingRemoval.Contains(p)).ToHashSet(StringComparer.Ordinal);
|
||||
var installed = InstalledPackages(stage).ToHashSet(StringComparer.Ordinal);
|
||||
var reasons = new HashSet<string>(StringComparer.Ordinal);
|
||||
foreach (Match match in ReasonLine().Matches(stage))
|
||||
{
|
||||
@@ -132,7 +129,7 @@ public sealed partial class ImageContentsTests
|
||||
}
|
||||
}
|
||||
|
||||
var installed = InstalledPackages(RuntimeStage()).Where(p => !PendingRemoval.Contains(p)).ToHashSet(StringComparer.Ordinal);
|
||||
var installed = InstalledPackages(RuntimeStage()).ToHashSet(StringComparer.Ordinal);
|
||||
Assert.IsTrue(installed.SetEquals(listed), $"Dockerfile: {string.Join(' ', installed.Order())}; guida: {string.Join(' ', listed.Order())}");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user