GoogleContainerTools / GoogleContainerTools/skaffold

Skaffold does not find previously built images from remote repository (GCP - GCR)

Open
#7,139 5 comments 0 reactions 0 assignees View on GitHub
area/build help wanted kind/feature-request priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Expected behavior
Do not rebuild the docker image when it is cached on a remote docker registry even you don't have the cached image on local
I saw the following old issue and PR, but the problem is still reproducible -
https://github.com/GoogleContainerTools/skaffold/issues/2197
https://github.com/GoogleContainerTools/skaffold/pull/2470
### Actual behavior
Rebuild the docker images regardless of the state on the remote registry.
If you have the cached image removed from your local, skaffold will trigger a full build of all images.
### Information

- Skaffold version: v1.36.0
- Operating system: macOS 12.1
- Installed via: downloaded from Github
- Contents of skaffold.yaml:

```yaml
apiVersion: skaffold/v2beta27
kind: Config
metadata:
name: deployment
build:
googleCloudBuild:
projectId: example
timeout: "1800s"
machineType: N1_HIGHCPU_8
artifacts:
- image: eu.gcr.io/example/push-events
docker:
dockerfile: backend/push-events-svc/Dockerfile
- image: eu.gcr.io/example/gateway
docker:
dockerfile: backend/rgateway/Dockerfile
- image: eu.gcr.io/example/dac-gateway
docker:
dockerfile: backend/dac-gateway/Dockerfile
- image: eu.gcr.io/example/events-store
docker:
dockerfile: backend/eventstore/Dockerfile
- image: eu.gcr.io/example/web-console
context: web
docker:
dockerfile: Dockerfile
buildArgs:
ENVIRONMENT: production
deploy:
kubectl:
manifests:
- k8s/gke/test/deployment/**
```

### Steps to reproduce the behavior
1. run `skaffold build`
2. cd ~/.skaffold && rm cache
3. run `skaffold build` again - remote cache is not recognized, skaffold triggeres a full re-build of all images

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.