denoland / deno_docker

Latest dockerfiles and images for Deno - alpine, centos, debian, ubuntu
https://hub.docker.com/r/denoland/deno
MIT License
873 stars 101 forks source link

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

Closed LukeChannings closed 5 months ago

LukeChannings commented 5 months ago

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

CLAassistant commented 5 months ago

CLA assistant check
All committers have signed the CLA.

LukeChannings commented 5 months ago

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