I created ./docker/app/Dockerfile with sth like this:
FROM php:7.3-apache
RUN a2enmod rewrite
RUN docker-php-ext-install pdo_mysql && docker-php-ext-enable pdo_mysql
(...)
My docker-compose:
app:
build: './docker/app/'
image: php:7.3-apache
ports:
- 80:80
volumes:
(...)
I'm trying to build clean instance of my container. I wish it will look like first build (I want to test if my Dockerfile is ok and will install all required packages).
But after making command:
docker-compose build app I see warnings like:
Module rewrite already enabled
warning: pdo_mysql (pdo_mysql.so) is already loaded!
Commands docker-compose build --force-rm app and docker-compose build --force-rm --no-cache app works the same. Packages installed once still persists and my Dockerfile's commands has no sense during the build.
So I have 2 questions:
1) How to build new clean version of my app container from scratch?
2) What commands docker-compose build and docker-compose build --force-rm are for if they don't build new image?