Have you ever faced an issue in which while building the docker image, even though you have mentioned “apt-get -y update” the package you are trying to install is not found in the repository?
Here, in this blog, we are going to discuss two common scenarios that I faced along with the root cause of this problem. Let’s take a look.
First, it’s important to remember that valid intermediate images are not built again. They are loaded from cache. Dockerfile cache is considered valid if the build command gives a 0 return code.
1. Consider the following Dockerfile.