@@ -71,6 +71,7 @@ type NativeBuildah struct {
7171 InstanceTmpDir string
7272 ConfigTmpDir string
7373 SignaturePolicyPath string
74+ ContainersConfigPath string
7475 RegistriesConfigPath string
7576 RegistriesConfigDirPath string
7677 Insecure bool
@@ -111,6 +112,15 @@ func NewNativeBuildah(commonOpts CommonBuildahOpts, opts NativeModeOpts) (*Nativ
111112 return nil , fmt .Errorf ("unable to write file %q: %w" , b .SignaturePolicyPath , err )
112113 }
113114
115+ b .ContainersConfigPath = filepath .Join (b .ConfigTmpDir , "containers.conf" )
116+ if err := ioutil .WriteFile (b .ContainersConfigPath , []byte (DefaultContainersConfig ), os .ModePerm ); err != nil {
117+ return nil , fmt .Errorf ("unable to write file %q: %w" , b .ContainersConfigPath , err )
118+ }
119+
120+ if err := os .Setenv ("CONTAINERS_CONF" , b .ContainersConfigPath ); err != nil {
121+ return nil , fmt .Errorf ("unable to set env var CONTAINERS_CONF: %w" , err )
122+ }
123+
114124 b .RegistriesConfigPath = filepath .Join (b .ConfigTmpDir , "registries.conf" )
115125 if err := ioutil .WriteFile (b .RegistriesConfigPath , []byte (DefaultRegistriesConfig ), os .ModePerm ); err != nil {
116126 return nil , fmt .Errorf ("unable to write file %q: %w" , b .RegistriesConfigPath , err )
0 commit comments