docker-maven-plugin: Cannot temporarily tag because target image already exists

Sometimes when we have target image already existing in system, and so caused the docker-maven-plugin failed to temporarily tag. After checked, found following code.

 if (!name.hasRegistry() && registry != null) {
            if (hasImage(targetImage)) {
                throw new DockerAccessException(
                    String.format("Cannot temporarily tag %s with %s because target image already exists. " +
                                  "Please remove this and retry.",
                                  name.getFullName(), targetImage));
            }

I guess it’s abnormal to interrupt the docker push with such errors, is it possible to remove the exception or add a parameter to toggle on/off the exception?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 11
  • Comments: 20 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Sorry for the super late response, not sure why this issue was below my radar.

I agree that we should be more conservative here and I’m going to tackle this for the next release.

@rhuss Any update on this? I’m running into the same issue and there have been two releases since your last post as far as I can tell.

I will try to make a release before the end of the week, or early next week.

Sorry for the delay, year end stress here 😃

Fixed in #1170.

@NancyChunlan we ended up moving away from this plugin actually. We are now doing the docker and java builds separately.