Skip to content

Commit

Permalink
feat(buildah): container runtime autodetection
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Lesikov <ilya@lesikov.com>
  • Loading branch information
ilya-lesikov committed Jun 17, 2022
1 parent c9b39c8 commit 695ae97
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion pkg/buildah/common.go
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion pkg/buildah/docker_with_fuse.go
Expand Up @@ -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
}

Expand Down
2 changes: 0 additions & 2 deletions pkg/buildah/native_linux.go
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 695ae97

Please sign in to comment.