Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools

Brendan Whiting
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,704 Points

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


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