Actual behavior
Using a minimal Dockerfile and that add an empty file and flag --reproducible results in different build hashes when built multiple times.
Expected behavior
The same hash for the docker images.
To Reproduce
Steps to reproduce the behavior:
Create Dockerfile
FROM ubuntu@sha256:7cfe75438fc77c9d7235ae502bf229b15ca86647ac01c844b272b56326d56184
COPY empty /
Dockerfile: above
Please provide either the Dockerfile you're trying to build or one that can reproduce this error.
Build Context
$ tree
── config.json
├── context
│ ├── Dockerfile
│ └── empty
└── run.sh (containing the command)
Kaniko Image: gcr.io/kaniko-project/executor latest 14c90714063c 4 weeks ago 63.1MB
EDIT 1:
Running container-diff does not yield any differences
$ container-diff diff <IMG_0> <IMG_1> --type=history --type=file --type=size
-----File-----
These entries have been added to <IMG_0> None
These entries have been deleted from <IMG_0> None
These entries have been changed between <IMG_0> and <IMG_1>: None
-----History-----
Docker history lines found only in <IMG_0>: None
Docker history lines found only in <IMG_1>: None
-----Size-----
Image size difference between <IMG_0> and <IMG_1>: None
Triage Notes for the Maintainers
EDIT 2:
I used diffoscope to inspect the file system layers of the docker containers and found the following differences:
Unlucky this is an already known issue, since version 1.8 as described here by bug 2005. Into such issue is described also the reason behind the anomalous behavior.
Actual behavior Using a minimal Dockerfile and that add an empty file and flag
--reproducible
results in different build hashes when built multiple times.Expected behavior The same hash for the docker images.
To Reproduce Steps to reproduce the behavior:
Create Dockerfile
Create empty file
Run kaniko build
Additional Information
gcr.io/kaniko-project/executor latest 14c90714063c 4 weeks ago 63.1MB
EDIT 1: Running
container-diff
does not yield any differencesTriage Notes for the Maintainers
EDIT 2: I used
diffoscope
to inspect the file system layers of the docker containers and found the following differences:It looks like they only differ in the modification time, which I guess should not happen when the
--reproducible
flag is passed, right?--cache
flag