Skip to content

Conversation

@snay2
Copy link
Contributor

@snay2 snay2 commented Feb 23, 2022

This ensures that the platform in the image manifest matches the platform of the binaries.

Issue #, if available: #584

Description of changes:

  • Modify the Dockerfile to pass through the docker buildx built-in arguments TARGETOS and TARGETARCH
  • Remove support for linux/arm and darwin/amd64 images, since they are not used in production workloads. Continuing to build them now would require using a different base image than amazonlinux:2, which does not support those architectures.
  • Continue using the older build system for Windows images, since docker buildx in our current GitHub Actions configuration does not support Windows builds.
  • Add a comment that explicitly annotating the image OS and architecture may not be necessary in the future

Testing:
Tested with GitHub Actions on my fork, publishing to an ECR Public repo in my personal AWS account. Windows and Linux builds worked successfully, and the manifests are correct.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This ensures that the platform in the image manifest matches the
platform of the binaries.
@snay2 snay2 requested a review from a team as a code owner February 23, 2022 18:03
@brycahta
Copy link
Contributor

Continue using the older build system for Windows images, since docker buildx in our current GitHub Actions configuration does not support Windows builds.

What kinda effort are we looking at to align the build with Windows? I'd rather not maintain 2 different systems

@snay2
Copy link
Contributor Author

snay2 commented Feb 23, 2022

Continue using the older build system for Windows images, since docker buildx in our current GitHub Actions configuration does not support Windows builds.

What kinda effort are we looking at to align the build with Windows? I'd rather not maintain 2 different systems

@brycahta Agreed, but currently it's a big unknown to me. I didn't discover it until yesterday. Have been trying to get a build running on a Windows laptop with buildx but so far no luck.

Documentation on that use case seems kinda scarce, too, oddly. Lots of "cross-compile all your Linux containers from a Windows machine" but very little of "use buildx on Windows to build Windows containers".

Should be possible, but I don't yet have any idea how much work it will be.

@snay2 snay2 force-pushed the docker-buildx-for-linux branch from 7f60ff0 to d249eac Compare February 23, 2022 22:00
This ensures that we will keep any existing images in the remote
manifest when we add the new image to that manifest list.
@snay2 snay2 force-pushed the docker-buildx-for-linux branch from d249eac to 80f7283 Compare February 23, 2022 22:12
@brycahta brycahta assigned brycahta and unassigned brycahta Feb 24, 2022
@brycahta brycahta self-requested a review February 24, 2022 17:37
Copy link
Contributor

@brycahta brycahta left a comment

Choose a reason for hiding this comment

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

Can you also update docker build commands in BUILD.md? It could also be a good place to add some info regarding Windows using build instead of buildx

@brycahta
Copy link
Contributor

and remove passive voice

🙏 many thanks

Copy link
Contributor

@brycahta brycahta left a comment

Choose a reason for hiding this comment

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

/lgtm

@snay2 snay2 merged commit 52228f5 into aws:main Feb 25, 2022
@snay2 snay2 deleted the docker-buildx-for-linux branch February 25, 2022 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants