Skip to content
Permalink
Browse files
feat(buildah): container runtime autodetection
Signed-off-by: Ilya Lesikov <ilya@lesikov.com>
  • Loading branch information
ilya-lesikov committed Jun 17, 2022
1 parent c9b39c8 commit 695ae97dfc28c23763257b20223f6de3b8758abb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
@@ -20,7 +20,6 @@ const (
DefaultShmSize = "65536k"
DefaultSignaturePolicy = `{"default": [{"type": "insecureAcceptAnything"}], "transports": {"docker-daemon": {"": [{"type": "insecureAcceptAnything"}]}}}`
DefaultRegistriesConfig = `unqualified-search-registries = ["docker.io"]`
DefaultRuntime = "crun"
BuildahImage = "registry.werf.io/werf/buildah:v1.22.3-1"
BuildahStorageContainerName = "werf-buildah-storage"

@@ -124,7 +124,7 @@ func (b *DockerWithFuseBuildah) BuildFromDockerfile(ctx context.Context, dockerf
}

func (b *DockerWithFuseBuildah) RunCommand(ctx context.Context, container string, command []string, opts RunCommandOpts) error {
_, _, err := b.runBuildah(ctx, []string{}, append([]string{"run", "--isolation", b.Isolation.String(), "--runtime", DefaultRuntime, container}, command...), opts.LogWriter)
_, _, err := b.runBuildah(ctx, []string{}, append([]string{"run", "--isolation", b.Isolation.String(), container}, command...), opts.LogWriter)
return err
}

@@ -184,7 +184,6 @@ func (b *NativeBuildah) Push(ctx context.Context, ref string, opts PushOpts) err
func (b *NativeBuildah) BuildFromDockerfile(ctx context.Context, dockerfile []byte, opts BuildFromDockerfileOpts) (string, error) {
buildOpts := define.BuildOptions{
Isolation: define.Isolation(b.Isolation),
Runtime: DefaultRuntime,
Args: opts.BuildArgs,
SignaturePolicyPath: b.SignaturePolicyPath,
ReportWriter: opts.LogWriter,
@@ -250,7 +249,6 @@ func (b *NativeBuildah) Umount(ctx context.Context, container string, opts Umoun
func (b *NativeBuildah) RunCommand(ctx context.Context, container string, command []string, opts RunCommandOpts) error {
runOpts := buildah.RunOptions{
Isolation: define.Isolation(b.Isolation),
Runtime: DefaultRuntime,
Args: opts.Args,
Mounts: opts.Mounts,
ConfigureNetwork: define.NetworkEnabled,

0 comments on commit 695ae97

Please sign in to comment.