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

Support for multi-arch (x86 + ARM64) images #341

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

LukeChannings
Copy link
Contributor

@LukeChannings LukeChannings commented Feb 13, 2024

Description

As mentioned in #337, Deno now provides official ARM64 builds. This PR makes the necessary changes for the denoland/deno images to be multi-architecture, meaning that a user on an ARM64 or x86 host can pull the same tag and be provided with an image compatible with their architecture.

cc @mmastrac @littledivy

Changes

  • Refactors the release workflow to use a local registry for storing the multi-arch images - docker save and docker load will only work with single architecture images.
  • Updates bin.dockerfile to handle TARGETARCH
  • Use the ubuntu-latest image. Justification: this build is essentially linking, not compiling, so it's faster if we're not waiting for a big runner to become available.

@CLAassistant
Copy link

CLAassistant commented Feb 13, 2024

CLA assistant check
All committers have signed the CLA.

@LukeChannings LukeChannings force-pushed the multi-arch-images branch 24 times, most recently from e0f767d to 154654a Compare February 13, 2024 18:44
@LukeChannings
Copy link
Contributor Author

Output of image validation tests:

$ docker buildx imagetools inspect localhost:5000/debian
Name:      localhost:5000/debian:latest
MediaType: application/vnd.oci.image.index.v1+json
Digest:    sha256:af49f9f031847e759e42696e137f59b097b684ca6f66071182131ec4b4de0c2c
           
Manifests: 
  Name:        localhost:5000/debian:latest@sha256:165bf0d9f7914dc7ff6fda8078261ae01148dc90844dd4de267e2dc44bc4862d
  MediaType:   application/vnd.oci.image.manifest.v1+json
  Platform:    linux/amd64
               
  Name:        localhost:5000/debian:latest@sha256:b17d8ef58109249f4f2c3fb7898a247746b73da6901ef8207d790eaa26733d1b
  MediaType:   application/vnd.oci.image.manifest.v1+json
  Platform:    linux/arm64
               
  Name:        localhost:5000/debian:latest@sha256:21ef2adc5c204efd0c8fb0b2f9347c1479f4e596a127c9088603fc67fa1d63d8
  MediaType:   application/vnd.oci.image.manifest.v1+json
  Platform:    unknown/unknown
  Annotations: 
    vnd.docker.reference.digest: sha256:165bf0d9f7914dc7ff6fda8078261ae01148dc90844dd4de267e2dc44bc4862d
    vnd.docker.reference.type:   attestation-manifest
               
  Name:        localhost:5000/debian:latest@sha256:500514e22018bdda2ede04215c667612c6e3d2da6101454e26e847bbcc4819e9
  MediaType:   application/vnd.oci.image.manifest.v1+json
  Platform:    unknown/unknown
  Annotations: 
    vnd.docker.reference.digest: sha256:b17d8ef58109249f4f2c3fb7898a247746b73da6901ef8207d790eaa26733d1b
    vnd.docker.reference.type:   attestation-manifest
$ docker run --rm --platform linux/amd64 localhost:5000/${{ matrix.kind }} sh -c 'file /usr/bin/deno'
/usr/bin/deno: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[xxHash]=2ba84ece8185469d, with debug_info, not stripped
$ docker run --rm --platform linux/arm64 localhost:5000/${{ matrix.kind }} sh -c 'file /usr/bin/deno'
/usr/bin/deno: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[xxHash]=432f974974c48879, with debug_info, not stripped

Copy link
Contributor

@mmastrac mmastrac left a comment

Choose a reason for hiding this comment

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

LGTM! @littledivy do you want to merge this for the next patch release?

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

Yup! LGTM

@littledivy littledivy merged commit fd276aa into denoland:main Feb 14, 2024
7 checks passed
@LukeChannings LukeChannings deleted the multi-arch-images branch February 14, 2024 09:05
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.

4 participants