Docker Community Forums

Share and learn in the Docker community.

How to specify parameters for build ( --force-rm ) when using docker compose


(Gladykov) #1

Hi all!

We are using docker compose up command with docker-compose.yml file, where we specify few services - some of them prebuilt (pulled as image from repo), some of them we build based on Dockerfiles. After building them we have many intermediate containers. To avoid it I would like to use switch --force-rm which can be passed to docker build command, but seems docker-compose.yml cannot contain it and you also cannot pass it as arg to docker compose. Any ideas how this can be achieved ?