Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-6263 Full arm64 support for Docker Images
  3. HDDS-8569

ozone-docker-runner: Push out arm64 Docker image so devs won't have to build that locally first

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: In Progress
    • Critical
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Push ozone-docker-runner arm64 Docker images to Docker Hub. So that devs with M1/M2 Macs won't have to build that locally first to avoid slow Docker Desktop qemu emulation.

      For example, airflow does have both arm64 and amd64 images, so that should be doable: https://hub.docker.com/r/apache/airflow/tags

      while ozone-docker-runner currently only has amd64 in Docker Hub: https://hub.docker.com/r/apache/ozone-runner/tags

      Found this wiki page Github Actions to DockerHub but not sure if this applies to ozone-docker-runner.

      I played with docker manifest a bit. I'm able to stitch existing x64 (amd64) image with a locally built arm64 image and push it to my Docker Hub public repo. Works with Docker Desktop macOS on an M1 Mac:

      # Docker Hub username
      DH_USERNAME=siyaom
      # git tag to target
      TAG=20230503-1
      
      docker pull apache/ozone-runner:${TAG}
      # grab x64 image from apache/ozone-runner, since it currently only has the x64 one
      docker tag apache/ozone-runner:${TAG} ${DH_USERNAME}/ozone-runner:${TAG}-amd64
      
      # build arm64 image locally, if it isn't built already
      DOCKER_BUILDKIT=1 docker build -t ${DH_USERNAME}/ozone-runner:${TAG}-arm64 .
      
      # have to actually push both images to Docker Hub before running `manifest create`
      docker push ${DH_USERNAME}/ozone-runner:${TAG}-amd64
      docker push ${DH_USERNAME}/ozone-runner:${TAG}-arm64
      
      # stitch multiple archs into one manifest
      docker manifest create ${DH_USERNAME}/ozone-runner:${TAG} \
      --amend ${DH_USERNAME}/ozone-runner:${TAG}-amd64 \
      --amend ${DH_USERNAME}/ozone-runner:${TAG}-arm64
      
      # `manifest push`! not image `push`
      docker manifest push ${DH_USERNAME}/ozone-runner:${TAG}
      
      # Ref: https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/
      

      Looks like it works: https://hub.docker.com/r/siyaom/ozone-runner/tags

      Though not sure why it says `arm64/v8`, not just `arm64` like airflow's.

      Note this manually stitching should not be necessary if we fix the automated build script in Apache Docker Hub.

      Attachments

        Activity

          People

            smeng Siyao Meng
            smeng Siyao Meng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: