@@ -322,7 +322,7 @@ rootless=%d
322
322
}
323
323
324
324
// Setup OCI hooks
325
- _ , err = b .setupOCIHooks (spec , (len (options .Mounts ) > 0 || len (volumes ) > 0 ))
325
+ _ , err = b .setupOCIHooks (spec , path , (len (options .Mounts ) > 0 || len (volumes ) > 0 ))
326
326
if err != nil {
327
327
return fmt .Errorf ("unable to setup OCI hooks: %w" , err )
328
328
}
@@ -383,7 +383,7 @@ rootless=%d
383
383
return err
384
384
}
385
385
386
- func (b * Builder ) setupOCIHooks (config * spec.Spec , hasVolumes bool ) (map [string ][]spec.Hook , error ) {
386
+ func (b * Builder ) setupOCIHooks (config * spec.Spec , bundlePath string , hasVolumes bool ) (map [string ][]spec.Hook , error ) {
387
387
allHooks := make (map [string ][]spec.Hook )
388
388
if len (b .CommonBuildOpts .OCIHooksDir ) == 0 {
389
389
if unshare .IsRootless () {
@@ -420,7 +420,7 @@ func (b *Builder) setupOCIHooks(config *spec.Spec, hasVolumes bool) (map[string]
420
420
}
421
421
}
422
422
423
- hookErr , err := hooksExec .RuntimeConfigFilter (context .Background (), allHooks ["precreate" ], config , hooksExec .DefaultPostKillTimeout )
423
+ hookErr , err := hooksExec .RuntimeConfigFilter (context .Background (), allHooks ["precreate" ], bundlePath , config , hooksExec .DefaultPostKillTimeout )
424
424
if err != nil {
425
425
logrus .Warnf ("Container: precreate hook: %v" , err )
426
426
if hookErr != nil && hookErr != err {
0 commit comments