Skip to content

Git features cause layer cache miss #1456

@steinybot

Description

@steinybot

I'm new to devcontainers and I have the following features:

  "features": {
    // Watch out for this. It always seems to have changes which causes a layer cache miss and everything to be rebuilt.
    //"ghcr.io/devcontainers/features/git:1": {},
    "ghcr.io/devcontainers/features/git-lfs:1": {
      // Set the version explicitly to avoid rebuilds.
      "version": "3.7.0",
      "autoPull": false
    },
    "ghcr.io/devcontainers/features/java:1": {
      "version": "11",
      "installGradle": "true"
    },
    "ghcr.io/devcontainers/features/node:1": {
      "version": "22"
    },
    "ghcr.io/devcontainers/features/python:1": {
      "version": "3.13"
    }
  },

The git and git-lfs features (possibly others but I haven't gotten that far yet) always cause a layer cache miss and cause all subsequent layers to be rebuilt. I thought that perhaps it was because the version wasn't being specified but pinning it makes no difference.

Features should cache right? Otherwise they are pretty much useless. Better off using a normal Dockerfile.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions