Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Improvement: Plugin/Docker: Enables image build for specified platform #1949

Merged
merged 4 commits into from
Aug 6, 2021

Conversation

xiaolin-ninja
Copy link
Contributor

Fixes #1881. Enables a platform HCL arg that is equivalent to docker build --platform flag. This only works with buildkit on (will fail with error).

Usage:

Add platform in waypoint.hcl


app "web" {
  build {
    use "docker" {
        platform = "linux/arm64/v8"
    }
  }

  deploy {
    use "docker" {
    }
  }
}

How to verify this works:

waypoint build
docker inspect <docker image> output should contain

"Architecture": "arm64",
        "Variant": "v8",
        "Os": "linux",

Merge after #1937.

Issue filed with Docker/Moby so that it may work without buildkit in the future.

🍐 with @izaaklauer thanks!

@hashicorp-cla
Copy link

hashicorp-cla commented Jul 28, 2021

CLA assistant check
All committers have signed the CLA.

@xiaolin-ninja xiaolin-ninja changed the title Feature: Plugin/Docker: Add platform flag to build Feature: Plugin/Docker: Enables image build for specified platform Jul 28, 2021
Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job @xiaolin-ninja ! I know this is still a draft, but it looks straightforward enough I figured I'd leave a review 😄 Looks good overall, just a few minor comments! ✨

.changelog/1949.txt Outdated Show resolved Hide resolved
builtin/docker/builder.go Outdated Show resolved Hide resolved
builtin/docker/builder.go Outdated Show resolved Hide resolved
builtin/docker/builder.go Outdated Show resolved Hide resolved
@xiaolin-ninja xiaolin-ninja changed the title Feature: Plugin/Docker: Enables image build for specified platform Improvement: Plugin/Docker: Enables image build for specified platform Aug 2, 2021
@xiaolin-ninja xiaolin-ninja marked this pull request as ready for review August 2, 2021 23:30
@briancain
Copy link
Member

I rebased this PR to fixup the merge conflict, fyi!

@izaaklauer izaaklauer merged commit 395d65e into main Aug 6, 2021
@izaaklauer izaaklauer deleted the feature/enable-platform-build branch August 6, 2021 17:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker build step does not support buildx
4 participants