I’m running in a hell since I try to avoid deploying some unchanged container, and want to use the digest to detect an image is the same … but I can’t have those digest to be the same.
I’m building a dotnet app, out of the container, then I COPY this app and dependencies in the container in order to ship & deploy it.
This is the dockerfile, obviously the ARGuments sent are exactly the same
ARG RUNTIME_IMAGE FROM $RUNTIME_IMAGE AS final COPY . /app/. EXPOSE 80 ARG PROJECT_NAME ENV RUN_PROJECT_NAME=$PROJECT_NAME ENTRYPOINT dotnet $RUN_PROJECT_NAME.dll
Already verified :
- the binaries are exactly the same (used container-diff to check this topic, then compared files from extracted folders in a diff/merged tool, i’m 100% sure)
- Also set always same the creation/access/write time of the files and directories copied
- Also set always same the creation/access/write time of the dockerfile itself
TAG IMAGE ID CREATED SIZE test11 sha256:74b1558ea77c84bf980281082719973a6d14b1eed24c23d434e589bb5b77db4e 2 seconds ago 279MB test10 sha256:2e8de287b201c415aa87fb4c06de95727d5e4474bc54c5ecfbf8e1697635e795 About a minute ago 279MB
This is how I build it :
docker build --build-arg RUNTIME_IMAGE=mcr.microsoft.com/dotnet/core/runtime:3.1 --build-arg PROJECT_NAME=My.Project.Name --file C:\_git\PROJECT\_.artifacts\app.dockerfile --force-rm --no-cache --tag my.project.name:test17 C:\_git\PROJECT\_.artifacts\My.Project.Name
Please help …