You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which seems to work, and importantly respects rules from .dockerignore. However if .dockerignore is present but is not itself ignored it leads to unstable (non-deterministic) image IDs.
This only happens when the Dockerfile is supplied on stdin; if an actual file is used instead the image ID is stable as expected.
Description
I want to generate a build context hash as requested in #32963. My workaround is
echo -e 'FROM scratch\nCOPY . .' | docker build --quiet -f - .
which seems to work, and importantly respects rules from
.dockerignore
. However if.dockerignore
is present but is not itself ignored it leads to unstable (non-deterministic) image IDs.This only happens when the Dockerfile is supplied on stdin; if an actual file is used instead the image ID is stable as expected.
Steps to reproduce the issue:
i.e. without a
.dockerignore
the image ID is stableadding a
.dockerignore
makes the image ID unstable (it is different every time!)but ignoring
.dockerignore
itself restores a stable image ID.Describe the results you received:
Image IDs are unstable (different every time).
Describe the results you expected:
Image IDs should be stable.
Additional information you deem important (e.g. issue happens only occasionally):
Only hapens when Dockerfile given on stdin.
Output of
docker version
:Output of
docker info
:The text was updated successfully, but these errors were encountered: