external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

use docker buildx for multi-arch docker image

Open mainred opened this issue 4 years ago • 7 comments

Description Before this change, docker image is built with the arch the same as host node even after ARCH is specified. Using docker buildx helps us build cross-platform multi-arch docker images

Fixes #ISSUE

Checklist

  • [ ] Unit tests updated
  • [ ] End user documentation updated

mainred avatar Oct 16 '21 16:10 mainred

Welcome @mainred!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Oct 16 '21 16:10 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mainred To complete the pull request process, please assign njuettner after the PR has been reviewed. You can assign the PR to them by writing /assign @njuettner in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Oct 16 '21 16:10 k8s-ci-robot

take an arm64 image push for example.

➜  external-dns git:(docker-buildx-for-multi-arch) IMAGE=qingchuanhao.azurecr.io/external-dns/external-dns ARCH=arm64 make build.push

➜  external-dns git:(docker-buildx-for-multi-arch) docker manifest inspect qingchuanhao.azurecr.io/external-dns/external-dns:external-dns-helm-chart-1.3.2-17-g4bac670e-dirty-arm64 --verbose
{
        "Ref": "qingchuanhao.azurecr.io/external-dns/external-dns:external-dns-helm-chart-1.3.2-17-g4bac670e-dirty-arm64",
        "Descriptor": {
                "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                "digest": "sha256:4d249e558feeecb49cc8404c6fa8a6e5c189f49d183ac4f9d90a1d52853c4801",
                "size": 1160,
                "platform": {
                        "architecture": "arm64",
                        "os": "linux"
                }
        },
        "SchemaV2Manifest": {
                "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                "schemaVersion": 2,
                "config": {
                        "mediaType": "application/vnd.docker.container.image.v1+json",
                        "digest": "sha256:bbeba1d79c3c0f563bcfc893b0f1753533306e79a6d164101081f2d61c0e5cf4",
                        "size": 1630
                },
                "layers": [
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "digest": "sha256:552d1f2373af9bfe12033568ebbfb0ccbb0de11279f9a415a29207e264d7f4d9",
                                "size": 2711827
                        },
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "digest": "sha256:887eec468cf81302a3b6351610d27415b4033d8eb1cb47c5e7df336df81e86b9",
                                "size": 405592
                        },
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "digest": "sha256:84849f92a532aa27ad22d9ee3f9eb9bbaa714a7d96d4291186ae5560cec5390b",
                                "size": 115250
                        },
                        {
                                "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                                "digest": "sha256:410340719201ec8a952356b6f6f7accb53403c37d3df99599da87033f180ad09",
                                "size": 17087535
                        }
                ]
        }
}

mainred avatar Oct 16 '21 16:10 mainred

ARCH=arm64 make build.docker returns the following error, which should have been fixed in https://github.com/golang/go/commit/f84d28b7755f256efda7830a3b78b46464497527 by ignoring the error unsupported VMA range

#16 1432.7 FATAL: ThreadSanitizer: unsupported VMA range
#16 1432.7 FATAL: Found 39 - Supported 48

mainred avatar Oct 18 '21 05:10 mainred

ping @Raffo @RaffoRaffo, PTAL, thanks.

mainred avatar Apr 19 '22 00:04 mainred

@mainred I’m going to take a look at this, I will have to try it on a machine to test it out. Do you think this will also bring performance improvements? Building images for all the archs in the way we are doing it today takes forever and prow doesn’t allow us to do much better from what I know.

Raffo avatar May 26 '22 09:05 Raffo

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Sep 12 '22 01:09 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Oct 12 '22 01:10 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-triage-robot avatar Nov 11 '22 01:11 k8s-triage-robot

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Nov 11 '22 01:11 k8s-ci-robot

CLA Missing ID CLA Not Signed

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mainred Once this PR has been reviewed and has the lgtm label, please assign njuettner for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Mar 11 '23 08:03 k8s-ci-robot

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Mar 11 '23 08:03 k8s-ci-robot

I am resurrecting this PR because we really needed. Given the time that has passed, I will likely just copy the content in my own PR to get it merged. I want to still spend time to thank the author @mainred for the original contribution.

Raffo avatar Mar 11 '23 15:03 Raffo