devcontainers / spec

Development Containers: Use a container as a full-featured development environment.
https://containers.dev
Creative Commons Attribution 4.0 International
3.61k stars 231 forks source link

Better support pre-builts with an image base #505

Open Clockwork-Muse opened 1 month ago

Clockwork-Muse commented 1 month ago

Currently, when creating a devcontainer, both the dockerfile-based build and the compose-based build can take advantage of docker's ability to pull cache from OCI registries (by using the name of the final pushed image) to potentially speed up the container build. This is possibly superior to pre-building based off of a separate devcontainer definition, since then you're only maintaining a single file.

Unfortunately, this isn't available at all for image-based builds.
It would be nice if there was a cache-from option available for image-based builds, similar to dockerfile-based builds, something like:

{
    "image": "some-image-that-has-most",
    // This would be new
    "cacheFrom": "pushed-image-version",
    "features": {
        "somethingExpensive": {
        },
    }
}

This would make setup potentially simpler for some use cases.

Tkelley325 commented 1 month ago

Sounds good to me.

Sent from Yahoo Mail for iPhone

On Monday, October 7, 2024, 6:56 PM, Stephen A. Imhoff @.***> wrote:

Currently, when creating a devcontainer, both the dockerfile-based build and the compose-based build can take advantage of docker's ability to pull cache from OCI registries (by using the name of the final pushed image) to potentially speed up the container build. This is possibly superior to pre-building based off of a separate devcontainer definition, since then you're only maintaining a single file.

Unfortunately, this isn't available at all for image-based builds. It would be nice if there was a cache-from option available for image-based builds, similar to dockerfile-based builds, something like: { "image": "some-image-that-has-most", // This would be new "cacheFrom": "pushed-image-version", "features": { "somethingExpensive": { }, } } This would make setup potentially simpler for some use cases.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>