This usually happens due to non-deterministic inputs in your image build. Common causes include:
- Unstable tar target: If your image includes a
.tarfile, it may embed unstable metadata such asmtime,ctime, or file ordering. Ensure tar files are created deterministically. - Stamped targets in metadata: If you use a Bazel target with
stamp = 1as input tolabelsorannotationsinoci_image, it will inject non-reproducible data (e.g. build timestamp). To avoid this:- Set
stamp = -1on the target (only stamped when--stampis passed). - Do not use always-stamped targets unless intentionally including build metadata.
- Set
To compare two image outputs and understand what changed, use diffoci.