Closed timo-klarshift closed 1 year ago
It looks like the following would fix it
diff --git a/pkg/devspace/build/builder/buildkit/buildkit.go b/pkg/devspace/build/builder/buildkit/buildkit.go
index b87d0b8f0..d5e12acf0 100644
--- a/pkg/devspace/build/builder/buildkit/buildkit.go
+++ b/pkg/devspace/build/builder/buildkit/buildkit.go
@@ -68,7 +68,7 @@ func (b *Builder) Build(ctx devspacecontext.Context) error {
func (b *Builder) ShouldRebuild(ctx devspacecontext.Context, forceRebuild bool) (bool, error) {
// Check if image is present in local registry
imageCache, _ := ctx.Config().LocalCache().GetImageCache(b.helper.ImageConfigName)
- imageName := imageCache.ResolveImage()
+ imageName := imageCache.ResolveImage() + ":" + imageCache.Tag
if imageCache.IsLocalRegistryImage() {
found, err := registry.IsImageAvailableRemotely(ctx.Context(), imageName)
diff --git a/pkg/devspace/build/builder/docker/docker.go b/pkg/devspace/build/builder/docker/docker.go
index 0da1f3237..173b42698 100644
--- a/pkg/devspace/build/builder/docker/docker.go
+++ b/pkg/devspace/build/builder/docker/docker.go
@@ -75,7 +75,7 @@ func (b *Builder) Build(ctx devspacecontext.Context) error {
func (b *Builder) ShouldRebuild(ctx devspacecontext.Context, forceRebuild bool) (bool, error) {
// Check if image is present in local registry
imageCache, _ := ctx.Config().LocalCache().GetImageCache(b.helper.ImageConfigName)
- imageName := imageCache.ResolveImage()
+ imageName := imageCache.ResolveImage() + ":" + imageCache.Tag
if imageCache.IsLocalRegistryImage() {
found, err := registry.IsImageAvailableRemotely(ctx.Context(), imageName)
@timo-klarshift Thanks! Good catch. I'll create a PR for this momentarily unless you would like to.
@lizardruss So we had some little overlap here. I provided a Pull Request. Not sure if its too late for mine
@timo-klarshift Not at all. I'll close mine.
This still is not fixed, I cannot get Devspace to not attempt to push to the local registry without the variable set in each devspace.yaml file. Even with this flag it will still attempt to push to localhost and fail on some images.
What happened?
./devspace/cache.yaml
the propertiesdockerfileHash
,contextHash
andimageContextHash
are never created whereas they should (according to the source code)Rebuild image localhost:30089/username/app because it was not found in the local registry
What did you expect to happen instead?
Images only rebuild when there is an actual change which would create a new image
How can we reproduce the bug? (as minimally and precisely as possible)
Then do
devspace dev
ordevspace deploy
You see that the image is rebuild every time.
The same happens if you choose
buildKit: {}
Local Environment:
Anything else we need to know?
I will provide a fix :)