Closed DatKyle closed 1 year ago
@DatKyle, The --force-recreate
is used only when a change is detected in docker artifacts or the previous cache is missing. As long as the compose file and it's services aren't changed, then the --force-recreate
will not be used. At this time, we don't have a way to override this behavior.
If your scenario is to exclude one or more services (that don't change often) from starting or debugging, consider Launch a subset of Compose services
Hi @ravipal, Thank you for the response and the extra info on how the --force-recreate
is applied to the command. Although using the --force-recreate
for any changes to the file or services is the exact thing I'm trying to avoid because it recreates all services.
The exact issue is when we make any changes, all services get recreated. So when we make a change to our API, the Angular gets recreated, which takes a long time to build. So it would be beneficial for us if there was a way to remove the --force-recreate
or if the tool selectively removed containers for recreation instead of just assuming all containers need recreating.
Where would I go to make a suggestion to change this behaviour?
@DatKyle, This is the right place for such suggestions in addition to VS developer community. We will look into removing the --force-recreate
flag.
I have a compose file with 3 services that I don't want to be recreated when starting the Docker-compose project:
When I added
<DockerComposeUpArguments>--no-recreate</DockerComposeUpArguments>
to the.dcproj
it failed to build as--force-recreate
is also applied to the Docker-compose up command, causing a conflict between the 2 argumentsThe main reason for not wanting to recreate services is because the angular takes 4 minutes to complete an initial build and then 10 seconds to recompile new changes. When the container is recreated it has to do an initial build, and since all services are recreated when you start the Docker-compose project it takes ages to develop and test.
Question
Is there a way to specify services to not be recreated or a way to remove the
--force-recreate
argument?