Skip to content

How to get one multi-platform image with separated dockerfiles? #272

Description

@iav

I need to use separate dockerfiles for different platforms, but want to see a result as one multi-platform image.
I try to use bake file:

cat bake.hcl
variable "V" {
    default = "latest"
}

group "default" {
    targets = ["inadyn-x64", "inadyn-arm"]
}

target "inadyn-x64" {
    dockerfile = "Dockerfile"
    context = "."
    platforms = ["linux/amd64"]
    tags = ["docker.io/shtripok/inadyn:${V}"]
}

target "inadyn-arm" {
    inherits = ["inadyn-x64"]
    dockerfile = "Dockerfile.arm"
    platforms = [ "linux/arm64", "linux/arm/v7" ]
}

but seems it first push x64 single platform image, then overwrite it with two-platform arm image.

Is it possible to get one tri-platform image with 2 different dockerfile?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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