@@ -11,7 +11,7 @@ use std::sync::{Arc, LazyLock};
1111use anyhow:: { Context , Result } ;
1212use lazy_regex:: regex;
1313use prek_consts:: env_vars:: EnvVars ;
14- use tracing:: { debug , trace, warn} ;
14+ use tracing:: { trace, warn} ;
1515
1616use crate :: cli:: reporter:: { HookInstallReporter , HookRunReporter } ;
1717use crate :: hook:: { Hook , InstallInfo , InstalledHook } ;
@@ -225,7 +225,7 @@ impl ContainerRuntimeInfo {
225225 match RuntimeKind :: from_str ( & val) {
226226 Ok ( runtime) => {
227227 if runtime != RuntimeKind :: Auto {
228- debug ! (
228+ trace ! (
229229 "Container runtime overridden by {}={}" ,
230230 EnvVars :: PREK_CONTAINER_RUNTIME ,
231231 val
@@ -253,7 +253,7 @@ impl ContainerRuntimeInfo {
253253 return RuntimeKind :: AppleContainer ;
254254 }
255255
256- debug ! ( "No container runtime found on PATH, defaulting to docker" ) ;
256+ trace ! ( "No container runtime found on PATH, defaulting to docker" ) ;
257257 RuntimeKind :: Docker
258258 }
259259
@@ -400,22 +400,24 @@ impl Docker {
400400 // the same as current `uid:gid` on the host - see subuid / subgid.
401401 }
402402
403+ // https://docs.docker.com/reference/cli/docker/container/run/#volumes-from
404+ // The `Z` option tells Docker to label the content with a private
405+ // unshared label. Only the current container can use a private volume.
403406 let work_dir = CONTAINER_RUNTIME . map_to_host_path ( work_dir) ;
404407 let z = if CONTAINER_RUNTIME . is_apple_container ( ) {
405408 "" // Not currently supported
406409 } else {
407410 ",Z"
408411 } ;
412+ let volume = format ! ( "{}:/src:rw{z}" , work_dir. display( ) ) ;
413+
409414 if !CONTAINER_RUNTIME . is_apple_container ( ) {
410415 // Run an init inside the container that forwards signals and reaps processes
411416 command. arg ( "--init" ) ;
412417 }
413418 command
414- // https://docs.docker.com/reference/cli/docker/container/run/#volumes-from
415- // The `Z` option tells Docker to label the content with a private
416- // unshared label. Only the current container can use a private volume.
417419 . arg ( "--volume" )
418- . arg ( format ! ( "{}:/src:rw{}" , work_dir . display ( ) , z ) )
420+ . arg ( volume )
419421 . arg ( "--workdir" )
420422 . arg ( "/src" ) ;
421423
0 commit comments