Creating a docker image for ARM architecture of a gradle project

I am trying to create a docker image for the arm architecture of my gradle project, below is the docker file that I am using to create a image for amd aarch

# this dockerfile is used for github action
FROM gradle:6.5.0-jdk8 as builder

# build
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle build

# settle down the executable
FROM adoptopenjdk:8-jdk-hotspot
COPY --from=builder /home/gradle/src/build/distributions/sample-1.0-SNAPSHOT.tar /app/
WORKDIR /app
RUN tar -xvf sample-1.0-SNAPSHOT.tar

# run
ENTRYPOINT /app/generator-1.0-SNAPSHOT/bin/sample

can someone suggest me what are the changes that I will have to make it working for ARM64 aarch.
right now I get below errors for ARm ARch

 => ERROR [linux/arm64 internal] load metadata for docker.io/library/gradle:6.5.0-jdk8                                                                                      4.9s
 => ERROR [linux/arm64 builder 1/4] FROM docker.io/library/gradle:6.5.0-jdk8

I believe that you would need to start with a different base image to build from. It seems that the gradle:6.5.0-jdk8 manifest does not have an entry for the arm64 architecture.

$ docker manifest inspect gradle:6.5.0-jdk8
{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
   "manifests": [
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 2211,
         "digest": "sha256:d0ac41d4ed19e30bb6cc803f78e50cf09810b8840d221c46a4df16d8d601a1c5",
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 2210,
         "digest": "sha256:ea7e2837a1fae1a92a35da361de0621676af3a6ff3dd59ace97bbdd84d95f45c",
         "platform": {
            "architecture": "ppc64le",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 2210,
         "digest": "sha256:5a24e0ef896acf5e089231e920cedeba8ba951518fc932ec2bdc46e780feb394",
         "platform": {
            "architecture": "s390x",
            "os": "linux"
         }
      }
   ]
}

Maybe you could change your builder image base to something like amazoncorretto:8, which does have a manifest entry for arm64 v8 architecture.