Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support detecting image name during docker:build from docker archive #1207

Closed
wrosenuance opened this issue Apr 12, 2019 · 1 comment
Closed

Comments

@wrosenuance
Copy link
Contributor

Description

When an image archive is saved with the docker:save mojo or using docker save on the command line, the archive contains a manifest that records the tags that were saved. Later, when loading the image using docker:build and dockerArchive, these tags are restored. However, if these tags do not match the configured in the image, then later actions by the plugin fail as they attempt to refer to a non-existent tag.

Info

In a workflow where containers are built, saved to an archive with docker:save, and published to a Maven artifactory, then retrieved later using maven-dependency-plugin and reloaded into the Docker server, it may be difficult to know exactly how the image was tagged when the docker:save happened.

For instance, images tagged with a snapshot timestamp, or built with a Git hash in the tag that is not part of the version, can still be attached and later retrieved by a project that doesn't know (and can't know) the actual build timestamp or hash. Images saved from outside of the plugin may have had a repository in the tag that could vary, or be absent sometimes and present other times.

In these cases, it would be useful to be able to scan the archive to find the tag that matches a pattern (e.g. with the tag containing a wildcard, or an optional prefix).

  • d-m-p version : 0.29-SNAPSHOT
  • Maven version (mvn -v) : 3.5.4
@rhuss
Copy link
Collaborator

rhuss commented Apr 12, 2019

Sound like a legit use case. Happy to help to integrate the PR you sent together with you.

@wrosenuance wrosenuance changed the title Support detecting image name in docker:save archive Support detecting image name during docker:build from docker archive Apr 12, 2019
wrosenuance added a commit to wrosenuance/docker-maven-plugin that referenced this issue Apr 17, 2019
…hives.

This PR implements the proposed pattern matching that scans the archive
prior to loading and then creates a tag from the image name loaded from
the archive to the image name configured in the Maven project.

Signed-off-by: William Rose <william.rose@nuance.com>
wrosenuance added a commit to wrosenuance/docker-maven-plugin that referenced this issue Apr 18, 2019
…hives.

This PR implements the proposed pattern matching that scans the archive
prior to loading and then creates a tag from the image name loaded from
the archive to the image name configured in the Maven project.

Signed-off-by: William Rose <william.rose@nuance.com>
wrosenuance added a commit to wrosenuance/docker-maven-plugin that referenced this issue Apr 20, 2019
…hives.

This PR implements the proposed pattern matching that scans the archive
prior to loading and then creates a tag from the image name loaded from
the archive to the image name configured in the Maven project.

Signed-off-by: William Rose <william.rose@nuance.com>

Add the ability to attach a saved image archive as a project artifact.

Signed-off-by: William Rose <william.rose@nuance.com>

PR fabric8io#1210 Remove saveAttach and just use saveClassifier.

Signed-off-by: William Rose <william.rose@nuance.com>

Issue fabric8io#1207 Specify image name pattern when loading from archives.

This PR implements the proposed pattern matching that scans the archive
prior to loading and then creates a tag from the image name loaded from
the archive to the image name configured in the Maven project.

Signed-off-by: William Rose <william.rose@nuance.com>
rhuss pushed a commit that referenced this issue Apr 21, 2019
…1208)

This PR implements the proposed pattern matching that scans the archive
prior to loading and then creates a tag from the image name loaded from
the archive to the image name configured in the Maven project.

Signed-off-by: William Rose <william.rose@nuance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants