How to fix error: Cannot find a valid baseurl for repo: base/7/x86_64 Error: building at STEP “RUN…

I was facing the same issue while building an image using this dockerfile