I am following the tutorial mentioned in the official Docker docs to build a docker image .
I have cloned the repo,installed docker and followed all the instructions .
It then tells to run the following command : docker build -t getting-started .
My build starts but suddenly fails in step 4.Attaching the logs for your reference .
[+] Building 72.0s (12/12) FINISHED
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 193B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> resolve image config for docker.io/docker/dockerfile:1 1.3s
=> CACHED docker-image://docker.io/docker/dockerfile:1@sha256:39b85bbfa7536a5feceb7372a0817649ecb2724562a 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> [internal] load .dockerignore 0.0s
=> [internal] load metadata for docker.io/library/node:18-alpine 1.3s
=> [internal] load build context 0.1s
=> => transferring context: 2.65kB 0.1s
=> [1/4] FROM docker.io/library/node:18-alpine@sha256:ca5d399560a9d239cbfa28eec00417f1505e5e108f3ec6938d2 0.0s
=> CACHED [2/4] WORKDIR /app 0.0s
=> [3/4] COPY . . 0.1s
=> ERROR [4/4] RUN yarn install --production 67.8s
------
> [4/4] RUN yarn install --production:
#12 1.994 yarn install v1.22.19
#12 2.574 [1/4] Resolving packages...
#12 3.959 [2/4] Fetching packages...
#12 9.694 error An unexpected error occurred: "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz: getaddrinfo EAI_AGAIN registry.yarnpkg.com".
#12 9.695 info If you think this is a bug, please open a bug report with the information provided in "/app/yarn-error.log".
#12 9.695 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
------
executor failed running [/bin/sh -c yarn install --production]: exit code: 1
Help me resolve this.