

For that reason, I used a simple Nginx webserver here since I think many of you are familiar with web servers, but not everyone knows how specific frameworks like ASP.NET Core works. The problem was a lack of basic understanding of Docker concepts, so it can happen with nearly every application and framework.

While this question was asked in the context of ASP.NET Core, it is not really related to this framework. It visualizes and also updates this answers with the knowledge and experience which I got in the last years using Docker on multiple systems (and also K8s). Since I got a lot of positive feedback to my previously, first visual explanation, I decided to create another video for this question and answer since there are some things which can be visualized better in a graphical video. Solution Video with visual explanation (from 2022) Docker seems to recommend building a new image instead of modifying a existing container, so I think the general way of rebuilding like I do is right, but some detail in the implementation has to be improved. Now the container should run the new version. My typical scenario would be: The application is running on the server in a Docker container.
#Using mediainfo .net core docker update#
What is the recommended way to update a container? It seems that docker is updating the image correctly, as the call of COPY src src would result in a layer id and no cache call: Step 6 : COPY src src I tried different things like -rm and -no-cache parameter for docker run and also stopping/removing the container before the new one is build. If thenĭocker run -d -p 5000:5000 -name $containerName $imageName ĬontainerRunning=$(docker inspect -format="" $containerName 2> /dev/null) My basic script for building: #!/bin/bashĭocker build -t $imageName -f Dockerfile. While Jenkins updates the files on my host correctly with Git, Docker doesn't apply this to my image. So in my workspace, I do the following in the dockerfile: WORKDIR /app 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 Jenkins.
