How to force Docker for a clean build of an image
In some extreme cases, your only way around recurring build failures is by running:
docker system prune
The command will ask you for your confirmation:
WARNING! This will remove: - all stopped containers - all volumes not used by at least one container - all networks not used by at least one container - all images without at least one container associated to themAre you sure you want to continue? [y/N]
This is of course not a direct answer to the question, but might save some lives... It did save mine.
The command docker build --no-cache .
solved our similar problem.
Our Dockerfile was:
RUN apt-get updateRUN apt-get -y install php5-fpm
But should have been:
RUN apt-get update && apt-get -y install php5-fpm
To prevent caching the update and install separately.