Skip to content

video-streaming.tf image built on macbook M1 caused standard_init_linux.go:228: exec user process caused: exec format error #8

@anhhchu

Description

@anhhchu

Due to the different in architecture, the Kubernetes deployment created using image built on Macbook M1 ran into standard_init_linux.go:228: exec user process caused: exec format error issue.

Suggesting below solution:

  1. Remove null_resource.docker_build

  2. Update null_resource.docker_push using docker buildx to build for multi-platform:

resource "null_resource" "docker_push" {

    depends_on = [ null_resource.docker_login ]

    triggers = {
        always_run = timestamp()
    }

    provisioner "local-exec" {
        command = "docker buildx build --platform linux/arm64,linux/amd64 -t ${local.image_tag} --file ../${local.service_name}/Dockerfile-prod ../${local.service_name} --push"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions