When I run skaffold dev, I expect to get unique cache hashes, when my buildArgs change.
The build is using the same cache key, regardless of the buildArgs
apiVersion: skaffold/v1beta14
kind: Config
profiles:
- name: reproduce
build:
local:
useBuildkit: true
artifacts:
- image: reproduce
docker:
buildArgs:
SOME_ARGUMENT: "{{.SOME_ARGUMENT}}"
FROM alpine
ARG SOME_ARGUMENT
RUN echo ${SOME_ARGUMENT}
SOME_ARGUMENT=without-cache skaffold dev --profile=reproduceListing files to watch...
- reproduce
List generated in 932.731碌s
Generating tags...
- reproduce -> reproduce:3178031-dirty
Tags generated in 2.94554ms
Checking cache...
- reproduce: Not found. Building
Cache check complete in 389.237碌s
Starting build...
Building [reproduce]...
[+] Building 0.4s (6/6) FINISHED
=> [internal] load build definition from Dockerfile
=> => transferring dockerfile: 99B
=> [internal] load .dockerignore
=> => transferring context: 2B
=> [internal] load metadata for docker.io/library/alpine:latest
=> CACHED [1/2] FROM docker.io/library/alpine
=> [2/2] RUN echo without-cache
=> exporting to image
=> => exporting layers
=> => writing image sha256:7544cf3257de0eebbe5bcaf8136619fe76a4e21d9d4c7424740ccd94b583f375
=> => naming to reproduce:3178031-dirty
The push refers to repository [reproduce]
7a45fe20619c: Preparing
03901b4a2ea8: Preparing
03901b4a2ea8: Layer already exists
7a45fe20619c: Pushed
3178031-dirty: digest: sha256:b1307ed2a65d50c875d503a2d236fdfedc86df5a937712e9b8b9c5e77b5684e6 size: 734
Build complete in 567.474661ms
Starting test...
Test complete in 4.307碌s
Tags used in deployment:
- reproduce -> reproduce:3178031-dirty@sha256:b1307ed2a65d50c875d503a2d236fdfedc86df5a937712e9b8b9c5e77b5684e6
Starting deploy...
SOME_ARGUMENT=with-cache skaffold dev --profile=reproduceListing files to watch...
- reproduce
List generated in 2.337227ms
Generating tags...
- reproduce -> reproduce:3178031-dirty
Tags generated in 6.120024ms
Checking cache...
- reproduce: Found
Cache check complete in 52.519435ms
Tags used in deployment:
- reproduce -> reproduce:3178031-dirty@sha256:b1307ed2a65d50c875d503a2d236fdfedc86df5a937712e9b8b9c5e77b5684e6
Starting deploy...
@Multiply thanks for filing this bug, I have a PR open to fix the issue.
That was incredibly fast. Thanks!
Thanks @Multiply
Hey @Multiply I just merged the fix. It should be in the next release; here's a link to download the bleeding edge binary which should incorporate the fix now.
@priyawadhwa Thanks! I'll test it first thing in the morning.