Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Brendan Whiting
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,735 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?