@@ -47,6 +47,37 @@ struct Cli {
4747 command : Command ,
4848}
4949
50+ #[ derive( Clone , Copy , Debug , Default , ValueEnum ) ]
51+ enum ComposeRunner {
52+ #[ default]
53+ DockerCompose ,
54+ NerdctlCompose ,
55+ }
56+
57+ impl ComposeRunner {
58+ fn as_str ( self ) -> & ' static str {
59+ match self {
60+ Self :: DockerCompose => "docker-compose" ,
61+ Self :: NerdctlCompose => "nerdctl-compose" ,
62+ }
63+ }
64+ }
65+
66+ #[ derive( Clone , Copy , Debug , ValueEnum ) ]
67+ enum Snapshotter {
68+ Overlayfs ,
69+ Stargz ,
70+ }
71+
72+ impl Snapshotter {
73+ fn as_str ( self ) -> & ' static str {
74+ match self {
75+ Self :: Overlayfs => "overlayfs" ,
76+ Self :: Stargz => "stargz" ,
77+ }
78+ }
79+ }
80+
5081#[ derive( Subcommand ) ]
5182enum Command {
5283 /// Deploy an app from a docker-compose file.
@@ -90,6 +121,12 @@ enum Command {
90121 /// build + hash the compose and print it, without deploying.
91122 #[ arg( long) ]
92123 dry_run : bool ,
124+ /// compose frontend used inside the guest.
125+ #[ arg( long, value_enum, default_value = "docker-compose" ) ]
126+ runner : ComposeRunner ,
127+ /// containerd snapshotter (supported only with --runner nerdctl-compose).
128+ #[ arg( long, value_enum) ]
129+ snapshotter : Option < Snapshotter > ,
93130 } ,
94131 /// List deployed apps.
95132 Apps ,
@@ -200,6 +237,8 @@ async fn main() -> Result<()> {
200237 no_kms,
201238 allowlist,
202239 dry_run,
240+ runner,
241+ snapshotter,
203242 } => {
204243 let compose = resolve_compose_arg ( compose, compose_file) ?;
205244 let image = if use_local_defaults {
@@ -231,6 +270,8 @@ async fn main() -> Result<()> {
231270 allowlist. as_deref ( ) ,
232271 dry_run,
233272 json,
273+ runner,
274+ snapshotter,
234275 )
235276 . await
236277 }
@@ -408,7 +449,12 @@ async fn cmd_deploy(
408449 allowlist : Option < & str > ,
409450 dry_run : bool ,
410451 json : bool ,
452+ runner : ComposeRunner ,
453+ snapshotter : Option < Snapshotter > ,
411454) -> Result < ( ) > {
455+ if matches ! ( runner, ComposeRunner :: DockerCompose ) && snapshotter. is_some ( ) {
456+ bail ! ( "--snapshotter is only supported with --runner nerdctl-compose" ) ;
457+ }
412458 let yaml = fs:: read_to_string ( compose_path)
413459 . with_context ( || format ! ( "reading compose file '{compose_path}'" ) ) ?;
414460
@@ -424,7 +470,14 @@ async fn cmd_deploy(
424470
425471 // each --volume declares a measured verity_volumes entry, so the built
426472 // app-compose (and thus app_id) binds the attested roots.
427- let app_compose = compose:: build_app_compose ( name, & yaml, !no_kms, & parsed_volumes) ;
473+ let app_compose = compose:: build_app_compose_with_runtime_and_volumes (
474+ name,
475+ & yaml,
476+ !no_kms,
477+ runner. as_str ( ) ,
478+ snapshotter. map ( Snapshotter :: as_str) ,
479+ & parsed_volumes,
480+ ) ;
428481
429482 let mut cfg = rpc:: VmConfiguration {
430483 name : name. to_string ( ) ,
0 commit comments