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

A placeholder in docker.image.tag isn't replaced by the final result when used during docker:build #1468

Closed
henri-tremblay opened this issue May 4, 2021 · 1 comment · Fixed by #1469

Comments

@henri-tremblay
Copy link
Contributor

Description

If the property docker.image.tag is set to %l and used in the image name, docker:build will fail to replace %l in the image name.

Info

The cause is that FormatParameterReplacer will do a lookup. In the lookup we get the docker.image.tag property but return directly instead of trying to replace the %l. Mysteriously, we only do that for docker.image.tag and not docker.image.repo or anything else.

See the demo project above to reproduce but the layout is:

  <properties>
    <docker.image.tag>%l</docker.image.tag>
    <docker.image.name>%a</docker.image.name>
    <docker.image.repo>${docker.image.name}</docker.image.repo>
  </properties>
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>0.35.0</version>
        <configuration>
          <images>
            <image>
              <name>${docker.image.repo}:${docker.image.tag}</name>
              <build>
                <from>adoptopenjdk:11-jre-hotspot</from>
              </build>
            </image>
          </images>
        </configuration>
      </plugin>
@rohanKanojia
Copy link
Member

@henri-tremblay: Thanks for reporting, Would you like to submit a fix for this issue?

@henri-tremblay henri-tremblay changed the title docker.image.tag doesn't behave normally when used during docker:build A placeholder in docker.image.tag isn't replaced by the final result when used during docker:build May 6, 2021
henri-tremblay pushed a commit to henri-tremblay/docker-maven-plugin that referenced this issue May 6, 2021
…is occurs when docker.image.name is constructed with ${docker.image.repo}:${docker.image.tag} (fabric8io#1468)
rohanKanojia pushed a commit to henri-tremblay/docker-maven-plugin that referenced this issue May 15, 2021
…is occurs when docker.image.name is constructed with ${docker.image.repo}:${docker.image.tag} (fabric8io#1468)
rohanKanojia pushed a commit that referenced this issue May 15, 2021
…is occurs when docker.image.name is constructed with ${docker.image.repo}:${docker.image.tag} (#1468) (#1469)

Co-authored-by: Henri Tremblay <Henri.Tremblay@tradingscreen.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
2 participants