Rebuild Docker container on file changes

前端 未结 3 1006
再見小時候
再見小時候 2020-12-22 18:49

For running an ASP.NET Core application, I generated a dockerfile which build the application and copys the source code in the container, which is fetched by Git using Jenki

3条回答
  •  星月不相逢
    2020-12-22 19:08

    You can run build for a specific service by running docker-compose up --build where the service name must match how did you call it in your docker-compose file.

    Example Let's assume that your docker-compose file contains many services (.net app - database - let's encrypt... etc) and you want to update only the .net app which named as application in docker-compose file. You can then simply run docker-compose up --build application

    Extra parameters In case you want to add extra parameters to your command such as -d for running in the background, the parameter must be before the service name: docker-compose up --build -d application

提交回复
热议问题