Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20.10 backport] dockerfile based binary building #3042

Merged
merged 9 commits into from
Apr 9, 2021

Conversation

tiborvass
Copy link
Collaborator

@tiborvass tiborvass commented Apr 6, 2021

Cherry-picks of #2996 and #2993 with added commit that reverses some changes in the main Makefile to limit the script changes within the same 20.10 release. The main purpose is to have darwin arm64 builds working in 20.10.

tonistiigi and others added 8 commits April 6, 2021 19:53
Using cross compilation toolchains that work from any platform
Adds darwin/arm64 support and bake targets. Static and dynamic
binary targets are available, both with glibc and musl.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 6423da8)
Signed-off-by: Tibor Vass <tibor@docker.com>
New solution is not hardcoded to amd64 but integrates
with the cross toolchain and support creating arm binaries.

Go has been updated so that ASLR works

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 8b822c9)
Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit a2a1de5)
Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit bd3e853)
Signed-off-by: Tibor Vass <tibor@docker.com>
More can be removed/refactored but avoiding a huge change.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 706e857)
Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit b099c9c)
Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 26b633d)
Signed-off-by: Tibor Vass <tibor@docker.com>
…ckwards compat

Signed-off-by: Tibor Vass <tibor@docker.com>
@tiborvass tiborvass marked this pull request as ready for review April 7, 2021 21:12
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah added this to the 20.10.6 milestone Apr 8, 2021
@thaJeztah thaJeztah changed the title [20.10] dockerfile based binary building [20.10 backport] dockerfile based binary building Apr 8, 2021
@tonistiigi
Copy link
Member

tonistiigi commented Apr 8, 2021

I guess we technically don't need to backport #2996 unless we really want to make a windows/arm64 release.

edit: not against windows/arm64 release so if we're going to do it I can lgtm.

@cpuguy83
Copy link
Collaborator

cpuguy83 commented Apr 8, 2021

Go doesn't recognize windows/arm64 as a valid target, though.

@tonistiigi
Copy link
Member

@cpuguy83
Copy link
Collaborator

cpuguy83 commented Apr 9, 2021

I really don't like the way this was done. I would also really prefer to not backport this to 20.10 because it breaks downstream builds.

Docker 20.10 only supports windows/amd64, and though tonistiigi/xx allows
us to support many other architectures, I preferred to not have to vendor in
12k lines of golang.org/x/sys just to get windows/arm64 working.

This is only meant for 20.10.

Signed-off-by: Tibor Vass <tibor@docker.com>
@tiborvass
Copy link
Collaborator Author

@tonistiigi Sorry I thought I pushed the changes to remove windows/arm64 and that sys vendor commit. Updated now.

@cpuguy83 I know it's not great to do this in 20.10 which is why I kept the Makefile as backwards compatible as possible while still building the new way. Which part specifically breaks down downstream for you?

@codecov-io
Copy link

Codecov Report

Merging #3042 (dc017bd) into 20.10 (55b2abb) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##            20.10    #3042   +/-   ##
=======================================
  Coverage   57.02%   57.02%           
=======================================
  Files         297      297           
  Lines       18679    18679           
=======================================
  Hits        10651    10651           
  Misses       7163     7163           
  Partials      865      865           

@tiborvass tiborvass merged commit 370c289 into docker:20.10 Apr 9, 2021
@cpuguy83
Copy link
Collaborator

cpuguy83 commented Apr 9, 2021

For posterity, talked with @tianon on Slack about this. This backport is not the same as master and makefile targets still work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants