Open danielgafni opened 1 year ago
Hi @danielgafni thank you for the feedback, I think it make sense to take Dockerfile into account when computing hash even if the file is not in the build context
It should also include changes to the buildArgs
, even if those do not affect the file source dependencies. For example:
# Dockerfile
ARG node_version
FROM node:${node_version}
# ...
# skaffold.yaml
apiVersion: skaffold/v4beta1
kind: Config
metadata:
name: example
build:
artifacts:
- image: example
docker:
buildArgs:
node_version: "18.x.x"
I've hit this same issue and have resorted to COPY
ing the Dockerfile
to /tmp as the last stage of all of my images to force it to be part of the digest.
I am using inputDigest
alongside tryImportMissing: true
to remote cache skaffold images from my Docker registry. This has been a lot more reliable than any other method of remote caching for me.
Expected behavior
Dockerfile should be taken into account when calculating the hash (even when outside the build context).
Actual behavior
The Dockerfile changes don't trigger a rebuild. In my case the Dockerfile is placed outside of the build context and is not included into the image.
Information
pacman
Steps to reproduce the behavior
Make the following project structure:
skaffold build
.Dockerfile
skaffold build