Actually , we can use the instruction docker-compose build --no-cache to avoid using the cache.
For instance , if we have the following docker-compose file
version: '2' services: service1: build: context: . container_name: service1_cont_name service2: build: context: . container_name: service2_cont_name
If we need to apply --no-cache only for service1 , it will be usefull to have an option in the build instruction to define this kind of action.
Hi!
You can already do this through docker-compose build --no-cache service1
. I'm not sure I agree that no-cache
should be part of the configuration.
Hi @shin- ,
docker-compose build --no-cache service1will only build service1 .
Kind of
docker-compose build --no-cache service1 && docker-compose build
Yes, that would be the way to go about it.
So , I think It would be more understandable to avoid running two commands for this kind of purpose. Why not adding a specific option in the build instruction, something like
version: '2' services: service1: build: context: . cache: false container_name: service1_cont_name service2: build: context: . container_name: service2_cont_name
Assuming the default value of cache is true . I think it would make more sense for the docker-compose file.
Most helpful comment
So , I think It would be more understandable to avoid running two commands for this kind of purpose. Why not adding a specific option in the build instruction, something like
Assuming the default value of cache is true . I think it would make more sense for the docker-compose file.