Development Tools

How do I force `docker-compose` to build from scratch, no cache?

In this tutorial, I've changed the calls to the eval function to parseInt as instructed, but when I run docker-compose up again, it keeps using the old version before the changes.

I've tried adding the --force-recreate and --always-recreate-deps flags.

(PS I confirmed that it's the old code by using a similar injection hack as shown in the video to print the contents of the file: console.log(require('fs').readFileSync('./app/routes/contributions.js').toString())).

1 Answer

Have you tried

docker-compose build --no-cache

build no cache

or just run

docker-compose down and docker-compose up

down

Either or should do the trick, are you running on windows or mac?

docker-compose build --no-cache worked, thank you