Skip to content

Configurable Previous Image #897

@ekcasey

Description

@ekcasey

Description

pack build should accept am optional --previous-image flag that allows users to set the previous image to a particular tag reference, digest reference, or (when performing a daemon build) image ID.

This is useful If I want to rebuild from a particular previous version of my app. Currently I would need to tag the previous image with the tag to which I want to export to force this behavior. This is an extra and potentially undesirable step.

Proposed solution

Usage: pack build --previous-image <prev-image> <image>

Lifecycle Arguments

When the builder is trusted, pack should invoke creator with the -previous-image flag or CNB_PREVIOUS_IMAGE env var.

creator -previous-image <prev-image> <image>

When the builder is not truster, pack should pass the previous image to analyzer

analyzer <prev-image>

Edge Cases

When pack build is called with --publish, <prev-image> must be in the same image registry as <image> (exporter currently does not support previous images in a different registry).

Until we have a better solution for managing caches volumes this feature will only be useful for reusing launch = true, cache = false layers, because the previous cache is not necessarily provided.

Additional context

  • This feature should be documented somewhere

Metadata

Metadata

Assignees

Labels

good first issueA good first issue to get started with.size/mdMedium level of effortstatus/readyIssue ready to be worked on.type/enhancementIssue that requests a new feature or improvement.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions