What all we learnt in docker implemented in current Project
Now regarding the docker size
what all we tried
we got to know that there is one extra log file consisting inside code with is huge which is of no use to be checked In and used in docker compose
we expected that size will come down after deleting that file or by adding that file in dockerignore file, so that that file is not used when code is complied.
but even after removing the size remained same.
also,we have seen the size of that file when compressed is very low although when extracted it is huge
and even file is copied when a container runs, file is overwritten, hence reducing the size
We also need to check why docker size in AWS ECR repo and when we download it in my local is different marginally???? |
Because the file which is pushed in ECR is compressed and saved. whereas locally it is extracted and saved.
we tried to see what all is copied
when we checked inside the docker image which we build after code build, the size of files in /app folder is around 75MB, but actual code was only 20 MB???
and we also saw that the file which we were curious about i.e. the error log file was overwritten when docker container runs.
Is there any way to check what all things are copied when docker compose is executed with a COPY command to copy all files inside the source folder.
Yes we tried to check what is being copied and it was working correctly
the reason for Size of code and size of /app folder is due to other 3rd party DLL copied when project was build and published.
we can try to build the project manually on local system and then check the size if it is same or different may be the file
We tried using command to see the history of image and found the source code for version 2.2 was highest contributor to the size , when checked with new version 3.0.0 the size was 40% Less [earlier 57 MB now 36 MB ]
I have also seen that now base image of ASP.core is not hosted on docker Hub but instead on azure MCR [Microsoft Container registry]
Comments
Post a Comment