Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$has_disclaimer is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_meta_box_present is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_send_notification is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_modify_title_and_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_heading is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_blz_affiliation_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskeywords is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_keywordsynonyms is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$response_body is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_indexnow_last_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
Container Linux su macOS con Apple Containerization

Container Linux su macOS con Apple Containerization

Apple ha annunciato Containerization, un nuovo progetto open source scritto in Swift che consente di eseguire container Linux in modo nativo su macOS con chip Apple Silicon. Prestazioni e sicurezza ai massimi livelli con l'alternativa a Docker.

Durante il keynote della conferenza WWDC25, Apple ha sorpreso la comunità degli sviluppatori annunciando Containerization, un nuovo pacchetto Swift open source pensato per portare l’esecuzione di container Linux in modo nativo su macOS. A differenza delle soluzioni tradizionali basate su Docker Desktop o ambienti virtualizzati monolitici, Containerization sfrutta un approccio più granulare e integrato, introducendo un paradigma tutto nuovo per l’esecuzione containerizzata su Mac basati su Apple Silicon.

Perché i container Linux su macOS? Un’esigenza evolutiva per sviluppatori e DevOps

Con l’aumento della diffusione dei container nel ciclo di vita dello sviluppo software, la possibilità di riprodurre ambienti Linux su macOS in modo leggero e isolato è diventata un requisito fondamentale per molti sviluppatori backend, DevOps e ingegneri CI/CD.

Apple affronta il problema eliminando il tradizionale modello di host VM più container runtime, che tipicamente introduce un overhead significativo in termini di risorse e manutenzione. Con Containerization, ogni container è isolato in una macchina virtuale leggera, costruita su misura per offrire:

  • Avvio in meno di un secondo
  • Superficie d’attacco minimale
  • Ridotta complessità del file system di base
  • Maggiore sicurezza grazie all’isolamento kernel-level

Architettura tecnica: Swift, virtualizzazione e ottimizzazione kernel

Il cuore di Containerization è scritto in Swift, il linguaggio di programmazione moderno e sicuro sviluppato da Apple. Questo non solo consente un’integrazione profonda con l’ecosistema macOS, ma permette anche di sfruttare appieno le prestazioni e le capacità dei Mac con chip Apple Silicon. Il sistema si basa a sua volta sul Virtualization.framework, una tecnologia nativa che consente la creazione e la gestione di macchine virtuali leggere direttamente sul sistema operativo.

A differenza delle soluzioni tradizionali che avviano un’unica pesante macchina virtuale per ospitare più container, Containerization esegue ogni container Linux all’interno della propria macchina virtuale isolata, riducendo il rischio di interferenze tra ambienti e migliorando l’affidabilità e la sicurezza. Grazie all’utilizzo di un kernel Linux ottimizzato e a un file system minimale, i container si avviano in tempi rapidissimi, spesso inferiori al secondo.

Un componente fondamentale di questo approccio è vminitd, un sistema di init leggerissimo scritto anch’esso in Swift. Questo piccolo daemon è il primo processo a partire all’interno della macchina virtuale e funge da intermediario tra il sistema host e il container, esponendo un’API gRPC tramite vsock. In questo modo, il processo esterno può configurare l’ambiente di runtime, gestire input/output, ricevere segnali e interagire direttamente con i processi containerizzati.

Cosa significa “OCI-compliant”?

Containerization è conforme con lo standard OCI, ovvero Open Container Initiative. Questo significa che supporta le specifiche aperte e condivise per i formati d’immagine dei container e per i runtime, garantendo compatibilità con l’ecosistema container esistente (come Docker e containerd). Essere OCI-compliant assicura che le immagini create o utilizzate da Containerization possano essere eseguite anche in altri ambienti containerizzati, e viceversa, promuovendo l’interoperabilità e riducendo il rischio di lock-in tecnologico.

Apple Containerization: differenze rispetto a Docker Desktop

Mentre Docker Desktop su macOS utilizza HyperKit (basato su Hypervisor.framework) per creare una macchina virtuale centrale che ospita container gestiti con Docker Engine e containerd, Containerization opera a un livello più basso e integrato, creando una macchina virtuale separata per ogni container.

Questa scelta assicura una serie di vantaggi chiave:

  • Rete dedicata per ogni container (IP statico senza port forwarding).
  • Maggiore sicurezza grazie all’isolamento VM-per-container.
  • Flessibilità del kernel per workload specifici.

All’atto pratico, Containerization potrebbe diventare la base per nuove implementazioni future, anche da parte di Docker.

Installazione e utilizzo di Containerization: container Linux su macOS con pochi passaggi

Per usare Containerization, sono necessari un sistema Mac con chip Apple Silicon (M1, M2, M3…), macOS 15 con Xcode 26 Beta oppure macOS 26 Beta 1, competenze di base per l’uso di make, Swift e shell scripting.

Per iniziare, è necessario clonare il repository GitHub di Apple con il seguente comando:

git clone https://github.com/apple/containerization.git
cd containerization

È quindi possibile proseguire con l’installazione di Swiftly, Swift e Static Linux SDK:

make cross-prep

Il comando scarica e configura automaticamente gli strumenti necessari per la compilazione multipiattaforma. Se si utilizzasse un terminale personalizzato, potrebbe risultare necessario procedere con lo spostamento del caricamento di env.sh da .zprofile a .zshrc. È sufficiente aggiungere la riga seguente (sostituendo <USERNAME> con il nome utente corretto):

. "/Users/<USERNAME>/.swiftly/env.sh"

Dopo aver chiuso e riaperto il terminale, si può verificare che sia tutto correttamente impostato usando il comando seguente:

which swift

Si dovrebbe ottenere una risposta simile alla seguente: /Users/<USERNAME>/.swiftly/bin/swift

Compilazione del pacchetto ed esecuzione dei test

Una volta completata la preparazione, si può avviare la compilazione. Il comando riportato di seguito costruisce il progetto e genera il tool cctl, i moduli Swift e il componente vminitd:

make all

Da ultimo, si può finalmente testare il funzionamento del sistema ed eventualmente scaricare un kernel Linux, il tutto seguendo le indicazioni riportate a questo indirizzo.

Utilizzo pratico con cctl

Uno dei modi migliori per familiarizzare con Containerization è utilizzare il tool cctl, incluso nel progetto. Questo strumento fornisce un’interfaccia a riga di comando per esplorare le API e provare funzioni chiave come:

  • Login ai repository dei container (container registries)
  • Manipolazione di immagini OCI
  • Creazione di filesystem ext4
  • Esecuzione di container in VM leggere

Per container registries (o registry di container) si intendono dei repository centralizzati (online o locali) in cui vengono archiviate, gestite e distribuite le immagini di container, come ad esempio immagini di Docker o immagini conformi allo standard OCI.

Qui si trovano tanti esempi di utilizzo. Tuttavia, il comando seguente scarica l’immagine Ubuntu dal registry, avvia una macchina virtuale e stampa il messaggio all’interno del container:

./cctl run --image ubuntu:latest -- echo "Hello from Linux container"

Ti consigliamo anche

Link copiato negli appunti