microsoft/navcontainerhelper

Reducing storage thumbprint caused by fonts loading

Opened this issue · 2 comments

Describe the issue

While tracking for excessive consummed storage on our containers host, we found that for every created container, the overall fonts directory was copied - meaning every time a container is spawn, we consume arround 400 MB on the host.

The thing is we need fonts, otherwise generated reports are not properly rendered (causing margin issues, letter padding issues, etc...)

Digging in sources, I figure that if we use the addFontsFromPath (which is what we do, of course), script is :

  1. creating a Fonts directory inside dedicated container path
  2. copying all listed font into that path

In order to enhance this and reduce storage thumbprint of created container, I see those two possible enhancements :

  • Instead copying fonts, we could simply mount the host font directory using read-only flag
  • Instead copying fonts in dedicated container directory, we could do this in a location used as cache and consumed by all containers
  • Unsure, but if the created directory is non longer used once the font is installed, we even can drop it

Scripts used to create container and cause the issue

$type = $env:type
$country = $env:country
$version = $env:version

$navCredentials = Get-Credential

$artifact = Get-BcArtifactUrl `
    -type $env:type `
    -country $env:country `
    -version $env:version

New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -artifactUrl $artifact `
    -Credential $navCredentials `
    -shortcuts None `
    -useSSL `
    -isolation process `
    -updateHosts `
    -multitenant `
    -addFontsFromPath c:\windows\fonts `
    -auth NavUserPassword `
    -useTraefik `
    -PublicDnsName $env:docker_host `
    -Restart no

Full output of scripts

2024-04-16T09:32:07.2196558Z ##[section]Starting: Create Container
2024-04-16T09:32:07.2678409Z ==============================================================================
2024-04-16T09:32:07.2678815Z Task         : PowerShell
2024-04-16T09:32:07.2678960Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2024-04-16T09:32:07.2679036Z Version      : 2.237.5
2024-04-16T09:32:07.2679163Z Author       : Microsoft Corporation
2024-04-16T09:32:07.2679301Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2024-04-16T09:32:07.2679399Z ==============================================================================
2024-04-16T09:32:08.8524813Z Generating script.
2024-04-16T09:32:08.8818451Z ========================== Starting Command Output ===========================
2024-04-16T09:32:08.9040750Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'E:\agents\tbs-docker-n01-a01\_work\_temp\d1bf1a7a-07fa-4406-8ce5-d8712e92ca84.ps1'"
2024-04-16T09:32:09.6006405Z BcContainerHelper version 6.0.11
2024-04-16T09:32:10.1413280Z Setting hostHelperFolder = E:\bccontainerhelper\data
2024-04-16T09:32:10.1472216Z Setting bcartifactsCacheFolder = E:\bccontainerhelper\artifacts
2024-04-16T09:32:10.1549381Z BC.HelperFunctions emits usage statistics telemetry to Microsoft
2024-04-16T09:32:10.7732170Z Running on Windows, PowerShell 5.1.17763.5576
2024-04-16T09:32:24.9323976Z BcContainerHelper is version 6.0.11
2024-04-16T09:32:24.9332056Z BcContainerHelper is running as administrator
2024-04-16T09:32:25.8943277Z HyperV is Disabled
2024-04-16T09:32:25.8964981Z UsePsSession is True
2024-04-16T09:32:25.8983710Z Host is Microsoft Windows Server 2019 Datacenter - 10.0.17763.5576
2024-04-16T09:32:25.9985485Z Docker Client Version is 24.0.4
2024-04-16T09:32:25.9995636Z Docker Server Version is 24.0.4
2024-04-16T09:32:26.2772639Z Removing Desktop shortcuts
2024-04-16T09:32:26.3649436Z Downloading artifact /sandbox/23.2.14098.18552/fr
2024-04-16T09:32:26.3978092Z Downloading C:\Windows\TEMP\00da019a-7667-4886-a9fd-af35f4c54821.zip
2024-04-16T09:32:26.4071159Z Downloading using WebClient
2024-04-16T09:33:12.5277857Z Unpacking artifact to tmp folder using Expand-Archive
2024-04-16T09:33:19.1849179Z Downloading platform artifact /sandbox/23.2.14098.18552/platform
2024-04-16T09:33:19.1877274Z Downloading C:\Windows\TEMP\1b4b2c8d-7934-4e4b-875c-d606370c4d55.zip
2024-04-16T09:33:19.1886338Z Downloading using WebClient
2024-04-16T09:34:14.9643755Z Unpacking artifact to tmp folder using Expand-Archive
2024-04-16T09:34:36.0296155Z Downloading Prerequisite Components
2024-04-16T09:34:36.0548704Z Downloading E:\bccontainerhelper\artifacts\sandbox\23.2.14098.18552\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi
2024-04-16T09:34:36.0557110Z Downloading using WebClient
2024-04-16T09:34:36.5079565Z Downloading E:\bccontainerhelper\artifacts\sandbox\23.2.14098.18552\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe
2024-04-16T09:34:36.5089032Z Downloading using WebClient
2024-04-16T09:34:40.7823912Z Fetching all docker images
2024-04-16T09:34:40.8629271Z Fetching all docker volumes
2024-04-16T09:34:40.9604386Z Enabling SSL as otherwise all clients will see mixed HTTP / HTTPS request, which will cause problems e.g. on the mobile and modern windows clients
2024-04-16T09:34:41.2956998Z Using image mcr.microsoft.com/businesscentral:ltsc2019
2024-04-16T09:34:41.3731295Z PublicDnsName is **********
2024-04-16T09:34:41.7837462Z Creating Container *******
2024-04-16T09:34:41.7845293Z Style: sandbox
2024-04-16T09:34:41.7852360Z Multitenant: Yes
2024-04-16T09:34:41.7859571Z Version: 23.2.14098.18552
2024-04-16T09:34:41.7866508Z Platform: 23.0.18534.0
2024-04-16T09:34:41.7876322Z Generic Tag: 1.0.2.17
2024-04-16T09:34:41.7901473Z Container OS Version: 10.0.17763.5576 (ltsc2019)
2024-04-16T09:34:41.7908659Z Host OS Version: 10.0.17763.5576 (ltsc2019)
2024-04-16T09:34:41.8002864Z Using process isolation
2024-04-16T09:34:41.8036221Z Using locale fr-FR
2024-04-16T09:34:41.8067780Z Adding special CheckHealth.ps1 to enable Traefik support
2024-04-16T09:34:41.8085667Z Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
2024-04-16T09:34:41.9192607Z Additional Parameters:
2024-04-16T09:34:41.9324582Z -e webserverinstance=**********
2024-04-16T09:34:41.9332746Z -e publicdnsname=**********
2024-04-16T09:34:41.9339863Z -l "traefik.protocol=https"
2024-04-16T09:34:41.9347063Z -l "traefik.web.frontend.rule=PathPrefix:/**********"
2024-04-16T09:34:41.9354620Z -l "traefik.web.port=443"
2024-04-16T09:34:41.9362024Z -l "traefik.soap.frontend.rule=PathPrefix:/**********soap;ReplacePathRegex: ^/**********soap(.*) /BC$1"
2024-04-16T09:34:41.9368770Z -l "traefik.soap.port=7047"
2024-04-16T09:34:41.9375747Z -l "traefik.rest.frontend.rule=PathPrefix:/**********rest;ReplacePathRegex: ^/**********rest(.*) /BC$1"
2024-04-16T09:34:41.9383418Z -l "traefik.rest.port=7048"
2024-04-16T09:34:41.9390647Z -l "traefik.dev.frontend.rule=PathPrefix:/**********dev;ReplacePathRegex: ^/**********dev(.*) /BC$1"
2024-04-16T09:34:41.9397662Z -l "traefik.dev.port=7049"
2024-04-16T09:34:41.9404739Z -l "traefik.snap.frontend.rule=PathPrefix:/**********snap;ReplacePathRegex: ^/**********snap(.*) /BC$1"
2024-04-16T09:34:41.9411545Z -l "traefik.snap.port=7083"
2024-04-16T09:34:41.9418402Z -l "traefik.dl.frontend.rule=PathPrefixStrip:/**********dl"
2024-04-16T09:34:41.9425166Z -l "traefik.dl.port=8080"
2024-04-16T09:34:41.9431848Z -l "traefik.dl.protocol=http"
2024-04-16T09:34:41.9438671Z -l "traefik.enable=true"
2024-04-16T09:34:41.9445451Z -l "traefik.frontend.entryPoints=https"
2024-04-16T09:34:41.9452173Z --env customNavSettings=PublicODataBaseUrl=https://**********/**********rest/odata,PublicSOAPBaseUrl=https://**********/**********soap/ws,PublicWebBaseUrl=https://**********/**********
2024-04-16T09:34:41.9458859Z Files in E:\bccontainerhelper\data\Extensions\**********\my:
2024-04-16T09:34:41.9610802Z - AdditionalOutput.ps1
2024-04-16T09:34:41.9618954Z - CheckHealth.ps1
2024-04-16T09:34:41.9626487Z - HelperFunctions.ps1
2024-04-16T09:34:41.9633901Z - MainLoop.ps1
2024-04-16T09:34:41.9641116Z - SetupVariables.ps1
2024-04-16T09:34:41.9648578Z - updatehosts.ps1
2024-04-16T09:34:41.9656051Z Creating container ********** from image mcr.microsoft.com/businesscentral:ltsc2019
2024-04-16T09:34:42.1878041Z 9a2fe915c8ee5b931721e87593e617075158aedc9601819f93a1ae8c7c22f0a3
2024-04-16T09:34:43.7366625Z Waiting for container ********** to be ready
2024-04-16T09:34:59.9919632Z Using artifactUrl https://bcartifacts.azureedge.net/sandbox/23.2.14098.18552/fr
2024-04-16T09:35:01.0690381Z Using installer from C:\Run\210-new
2024-04-16T09:35:01.0690822Z Installing Business Central: multitenant=True, installOnly=False, filesOnly=False, includeTestToolkit=False, includeTestLibrariesOnly=False, includeTestFrameworkOnly=False, includePerformanceToolkit=False, appArtifactPath=c:\dl\sandbox\23.2.14098.18552\fr, platformArtifactPath=c:\dl\sandbox\23.2.14098.18552\platform, databasePath=c:\dl\sandbox\23.2.14098.18552\fr\BusinessCentral-FR.bak, licenseFilePath=c:\dl\sandbox\23.2.14098.18552\fr\Cronus.bclicense, rebootContainer=True
2024-04-16T09:35:01.0691166Z Installing from artifacts
2024-04-16T09:35:02.1437424Z Starting Local SQL Server
2024-04-16T09:35:03.2238959Z Starting Internet Information Server
2024-04-16T09:35:03.2239252Z Copying Service Tier Files
2024-04-16T09:35:03.2239437Z c:\dl\sandbox\23.2.14098.18552\platform\ServiceTier\Program Files
2024-04-16T09:35:03.2239665Z c:\dl\sandbox\23.2.14098.18552\platform\ServiceTier\System64Folder
2024-04-16T09:35:03.2242678Z Copying PowerShell Scripts
2024-04-16T09:35:03.2242985Z c:\dl\sandbox\23.2.14098.18552\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
2024-04-16T09:35:03.2243940Z c:\dl\sandbox\23.2.14098.18552\platform\WindowsPowerShellScripts\WebSearch
2024-04-16T09:35:03.2244143Z Copying Web Client Files
2024-04-16T09:35:06.4526751Z c:\dl\sandbox\23.2.14098.18552\platform\WebClient\Microsoft Dynamics NAV
2024-04-16T09:35:06.4526957Z Copying ModernDev Files
2024-04-16T09:35:06.4527068Z c:\dl\sandbox\23.2.14098.18552\platform
2024-04-16T09:35:06.4527177Z c:\dl\sandbox\23.2.14098.18552\platform\ModernDev\program files\Microsoft Dynamics NAV
2024-04-16T09:35:06.4527278Z Copying additional files
2024-04-16T09:35:06.4527368Z Copying ConfigurationPackages
2024-04-16T09:35:06.4527475Z C:\dl\sandbox\23.2.14098.18552\fr\ConfigurationPackages
2024-04-16T09:35:06.4527570Z Copying Test Assemblies
2024-04-16T09:35:06.4527669Z C:\dl\sandbox\23.2.14098.18552\platform\Test Assemblies
2024-04-16T09:35:06.4527751Z Copying Extensions
2024-04-16T09:35:06.4527829Z C:\dl\sandbox\23.2.14098.18552\fr\Extensions
2024-04-16T09:35:06.4527925Z Copying Applications
2024-04-16T09:35:06.4529720Z C:\dl\sandbox\23.2.14098.18552\platform\Applications
2024-04-16T09:35:06.4529882Z Copying Applications.FR
2024-04-16T09:35:06.4530033Z C:\dl\sandbox\23.2.14098.18552\fr\Applications.FR
2024-04-16T09:35:06.4530139Z Copying dependencies
2024-04-16T09:35:22.7973461Z Copying ReportBuilder
2024-04-16T09:35:23.8727875Z Importing PowerShell Modules
2024-04-16T09:35:30.3894930Z Restoring CRONUS Demo Database
2024-04-16T09:35:31.4617061Z Setting CompatibilityLevel for tenant on localhost\SQLEXPRESS
2024-04-16T09:35:55.4366957Z Exporting Application to CRONUS
2024-04-16T09:35:59.7361722Z Removing Application from tenant
2024-04-16T09:35:59.7361987Z Modifying Business Central Service Tier Config File for Docker
2024-04-16T09:35:59.7362193Z Creating Business Central Service Tier
2024-04-16T09:35:59.7362322Z Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
2024-04-16T09:36:12.8110719Z Starting Business Central Service Tier
2024-04-16T09:36:13.8909648Z Importing license file
2024-04-16T09:36:13.8909916Z Copying Database on localhost\SQLEXPRESS from tenant to default
2024-04-16T09:36:14.9701587Z Taking database tenant offline
2024-04-16T09:36:14.9701774Z Copying database files
2024-04-16T09:36:19.2642780Z Attaching files as new Database default
2024-04-16T09:36:19.2643131Z Putting database tenant back online
2024-04-16T09:36:19.2643213Z Mounting tenant database
2024-04-16T09:38:28.7951174Z Mounting Database for default on server localhost\SQLEXPRESS with AllowAppDatabaseWrite = False
2024-04-16T09:38:29.8749831Z Sync'ing Tenant
2024-04-16T09:38:29.8750050Z Tenant is Operational
2024-04-16T09:38:30.9543394Z Stopping Business Central Service Tier
2024-04-16T09:38:30.9543701Z Installation took 210 seconds
2024-04-16T09:38:30.9543784Z Installation complete
2024-04-16T09:38:30.9543856Z Initializing...
2024-04-16T09:38:30.9543997Z Setting host.containerhelper.internal to 172.22.208.1 in container hosts file
2024-04-16T09:38:30.9544098Z Starting Container
2024-04-16T09:38:30.9547106Z Hostname is **********
2024-04-16T09:38:30.9547339Z PublicDnsName is **********
2024-04-16T09:38:30.9547572Z Using NavUserPassword Authentication
2024-04-16T09:38:32.0322126Z Creating Self Signed Certificate
2024-04-16T09:38:32.0322334Z Self Signed Certificate Thumbprint A319603120853579FCC96E1795235D24A6E15044
2024-04-16T09:38:32.0322533Z DNS identity **********
2024-04-16T09:38:32.0322670Z Modifying Service Tier Config File with Instance Specific Settings
2024-04-16T09:38:32.0322797Z Modifying Service Tier Config File with settings from environment variable
2024-04-16T09:38:32.0322981Z Setting PublicODataBaseUrl to https://**********/**********rest/odata
2024-04-16T09:38:32.0323116Z Setting PublicSOAPBaseUrl to https://**********/**********soap/ws
2024-04-16T09:38:32.0323272Z Setting PublicWebBaseUrl to https://**********/**********
2024-04-16T09:38:38.6334322Z Starting Service Tier
2024-04-16T09:38:38.6334774Z CertificateThumprint A319603120853579FCC96E1795235D24A6E15044
2024-04-16T09:38:38.6334872Z Registering event sources
2024-04-16T09:38:38.6335046Z Creating DotNetCore Web Server Instance
2024-04-16T09:38:38.6335140Z Using application pool name: **********
2024-04-16T09:38:38.6335277Z Using default container name: NavWebApplicationContainer
2024-04-16T09:38:40.8035424Z Copy files to WWW root C:\inetpub\wwwroot\**********
2024-04-16T09:38:41.8826148Z Create the application pool **********
2024-04-16T09:38:42.9746035Z Create website: NavWebApplicationContainer with SSL
2024-04-16T09:38:42.9746375Z Update configuration: navsettings.json
2024-04-16T09:38:42.9746636Z Done Configuring Web Client
2024-04-16T09:38:42.9746807Z Enabling Financials User Experience
2024-04-16T09:38:42.9746964Z Dismounting Tenant
2024-04-16T09:38:42.9747156Z Mounting Tenant
2024-04-16T09:39:48.5576536Z Mounting Database for default on server localhost\SQLEXPRESS with AllowAppDatabaseWrite = False
2024-04-16T09:39:49.6327151Z Sync'ing Tenant
2024-04-16T09:39:49.6327405Z Tenant is Operational
2024-04-16T09:39:50.7067181Z Creating http download site
2024-04-16T09:39:50.7067356Z Setting SA Password and enabling SA
2024-04-16T09:39:51.7812035Z Creating admin as SQL User and add to sysadmin
2024-04-16T09:39:58.3413861Z Creating SUPER user
2024-04-16T09:39:58.3414061Z Container IP Address: 172.22.216.105
2024-04-16T09:39:58.3414149Z Container Hostname  : **********
2024-04-16T09:39:58.3414239Z Container Dns Name  : **********
2024-04-16T09:39:58.3414360Z Web Client          : https://**********/**********/?tenant=default
2024-04-16T09:39:58.3417874Z Dev. Server         : https://**********
2024-04-16T09:39:58.3419311Z Dev. ServerInstance : BC
2024-04-16T09:39:58.3419510Z Dev. Server Tenant  : default
2024-04-16T09:39:58.3419614Z Setting ********** to 172.22.216.105 in host hosts file
2024-04-16T09:39:58.3419724Z Setting **********-default to 172.22.216.105 in host hosts file
2024-04-16T09:39:58.3419849Z Setting **********-default to 172.22.216.105 in container hosts file
2024-04-16T09:39:58.3419913Z 
2024-04-16T09:39:58.3419971Z Files:
2024-04-16T09:39:58.3420352Z http://**********:8080/ALLanguage.vsix
2024-04-16T09:39:58.3420488Z http://**********:8080/certificate.cer
2024-04-16T09:39:58.3420541Z 
2024-04-16T09:39:58.3420613Z Container Total Physical Memory is 128.0Gb
2024-04-16T09:39:58.3421607Z Container Free Physical Memory is 53.9Gb
2024-04-16T09:39:58.3421675Z 
2024-04-16T09:39:58.3421769Z Initialization took 88 seconds
2024-04-16T09:39:58.3422065Z Ready for connections!
2024-04-16T09:40:01.4888632Z Reading CustomSettings.config from **********
2024-04-16T09:40:02.7214522Z Skipping font 'lucon.ttf' as it is already installed
2024-04-16T09:40:23.2972615Z Installing fonts - Completed
2024-04-16T09:40:23.4680652Z Cleanup old dotnet core assemblies
2024-04-16T09:40:23.4744660Z Container ********** successfully created
2024-04-16T09:40:23.4752365Z Because of Traefik, the following URLs need to be used when accessing the container from outside your Docker host:
2024-04-16T09:40:23.4759165Z Web Client:        https://**********/**********
2024-04-16T09:40:23.4766302Z SOAP WebServices:  https://**********/**********soap
2024-04-16T09:40:23.4772934Z OData WebServices: https://**********/**********rest
2024-04-16T09:40:23.4779186Z Dev Service:       https://**********/**********dev
2024-04-16T09:40:23.4785665Z Snapshot Service:  https://**********/**********snap
2024-04-16T09:40:23.4792109Z File downloads:    https://**********/**********dl
2024-04-16T09:40:24.8111140Z Health check returns False, restarting container
2024-04-16T09:40:25.6735693Z Removing Session **********
2024-04-16T09:40:31.7932729Z **********
2024-04-16T09:40:31.9359020Z Waiting for container ********** to be ready
2024-04-16T09:40:33.0152126Z 
2024-04-16T09:40:33.0152607Z Initializing...
2024-04-16T09:40:33.0152762Z Setting host.containerhelper.internal to 172.22.208.1 in container hosts file
2024-04-16T09:40:33.0152903Z Restarting Container
2024-04-16T09:40:33.0153032Z PublicDnsName unchanged
2024-04-16T09:40:33.0153154Z Hostname is **********
2024-04-16T09:40:33.0155582Z PublicDnsName is **********
2024-04-16T09:40:34.0956144Z Using NavUserPassword Authentication
2024-04-16T09:40:35.1723785Z Starting Local SQL Server
2024-04-16T09:40:35.1724112Z Starting Internet Information Server
2024-04-16T09:40:44.9574681Z Starting Service Tier
2024-04-16T09:40:44.9574954Z Container IP Address: 172.22.212.88
2024-04-16T09:40:44.9575097Z Container Hostname  : **********
2024-04-16T09:40:44.9575209Z Container Dns Name  : **********
2024-04-16T09:40:44.9575346Z Web Client          : https://**********/**********?tenant=default
2024-04-16T09:40:44.9575508Z Dev. Server         : https://**********
2024-04-16T09:40:44.9575612Z Dev. ServerInstance : BC
2024-04-16T09:40:44.9575709Z Dev. Server Tenant  : default
2024-04-16T09:40:47.1073411Z Setting ********** to 172.22.212.88 in host hosts file
2024-04-16T09:40:47.1073627Z Setting **********-default to 172.22.212.88 in host hosts file
2024-04-16T09:40:47.1073774Z Setting **********-default to 172.22.212.88 in container hosts file
2024-04-16T09:40:47.1073830Z 
2024-04-16T09:40:47.1073892Z Files:
2024-04-16T09:40:47.1074044Z http://**********:8080/ALLanguage.vsix
2024-04-16T09:40:47.1077146Z http://**********:8080/certificate.cer
2024-04-16T09:40:47.1077343Z 
2024-04-16T09:40:47.1077484Z Container Total Physical Memory is 128.0Gb
2024-04-16T09:40:47.1077674Z Container Free Physical Memory is 56.3Gb
2024-04-16T09:40:47.1077743Z 
2024-04-16T09:40:47.1077867Z Initialization took 14 seconds
2024-04-16T09:40:47.1080544Z Ready for connections!
2024-04-16T09:40:48.6473276Z Waiting for tenants to be mounted
2024-04-16T09:40:55.1854677Z 
2024-04-16T09:40:55.1862016Z Use:
2024-04-16T09:40:55.1875623Z Get-BcContainerEventLog -containerName ********** to retrieve a snapshot of the event log from the container
2024-04-16T09:40:55.1888429Z Get-BcContainerDebugInfo -containerName ********** to get debug information about the container
2024-04-16T09:40:55.1901027Z Enter-BcContainer -containerName ********** to open a PowerShell prompt inside the container
2024-04-16T09:40:55.1913783Z Remove-BcContainer -containerName ********** to remove the container again
2024-04-16T09:40:55.1926488Z docker logs ********** to retrieve information about URL's again
2024-04-16T09:40:56.0396368Z ##[section]Finishing: Create Container

I assume that the 400Mb consumed for fonts is removed again when deleting the container, right?
I likely won't have time to create optimizations for stuff like this, but there are several things you can do right:

You can try to remove the fonts folder Remove-Item -Path (Join-Path $bcContainerHelperConfig.HostHelperFolder "Extensions/$containerName/Fonts") -Recurse -Force after the container is generated to see whether this indeed is possible?

You could also create a folder, which contains the fonts you actually need and install those instead of just using all fonts on the host (which can be a lot).

If you find that the fonts folder can be removed, and it still works after restarting the container, and it still works for Windows 2016 containers, and it still works for Windows 2019 containers and it still works for Windows 2022 containers (and make sure that this works for all BC versions - I cannot see why not though), then I would accept a PR, which removes the fonts folder after installing the fonts - but small optimizations like this requires a lot of testing...

Hi Freddy,

Yes, i confirm that dropping the container using Remove-BcContainer is releasing this space as it's dropping both the container and shared container directory.

I'll make a few tests and submit a Pull Request when I got something which make sense.

I of course didn't wait exclusively after you in order to address this case. My purpose was much more to track and talk about the case to figure what's the best approach to solve it 🙂