I solved this issue by adding RUN npm install -g node-gyp before yarn install.
RUN npm install -g node-gyp