Build a docker image using Dockerfile pushing same image to Artifactory. I noticed that when using apk --no-cache the sha256 changes although Dockerfile did not.
I pushed 3 different images to Artifactory, and when checking i noticed 3 different layers - does it means it occupies 3 layers instead of having reference to the first layer pushed?
I build the same Dockerfile 3 times, and pushed the image to Artifactory. Checking the image layers i noticed 3 images with different layers (different sha256).
FROM alpine:3.9
ADD resources/repositories /etc/apk/repositories
RUN apk --no-cache add curl && apk --no-cache add --repository http://myartifactory.com:8081/artifactory/alpine-nl-remote/alpine/edge/testing gosu
Running (where build 1 changes to 2 and 3)
docker build -t myartifactory.com/apline:3.9-1
docker push
Checking Artifactory I now have 3 layers each image. Once layer is different and two layers are same in all 3 images
Same image should be build with same sha256 and Artifactory should have one copy of the image and 2 more references pointing to that image