fabric8io / docker-maven-plugin

Maven plugin for running and creating Docker images
https://dmp.fabric8.io
Apache License 2.0
1.88k stars 644 forks source link

Port Mapping not work when using external compose file #1240

Open chanjarster opened 5 years ago

chanjarster commented 5 years ago

Description

When using compose file, dynamic port selection doesn't work anymore. Furthermore, the port mapping properties disappears too:

<images>
  <image>
    <name>tomcat:8.5-alpine</name>
    <alias>tomcat</alias>
    <external>
      <type>compose</type>
      <basedir>${project.basedir}</basedir>
    </external>
    <run>
      <ports>
        <port>tomcat.port:8080</port>
      </ports>
      <wait>
        <log>Server startup in [0-9.]+ ms</log>
        <time>120000</time>
      </wait>
    </run>
  </image>
</images>

Property tomcat.port is empty.

I have created a sample project at https://github.com/chanjarster/dmp-bug/tree/master/portmapping-compose-not-work

Info

rhuss commented 5 years ago

Sounds like a legit bug. Does it worked already for you at some version ? And if so, at which version ? (sorry for the delayed response btw)

chanjarster commented 5 years ago

I use d-m-p of version 0.30.0. It doesn't work.

rhuss commented 5 years ago

My question is, did it ever worked for you because you are writing

When using compose file, dynamic port selection doesn't work anymore.

And if so, in which version did it work for you ?

chanjarster commented 5 years ago

For version 0.30.0, it works if I don't use compose file, it never worked if I use compose file. I didn't try other versions.

rhuss commented 5 years ago

Ok, so that might then be a limitation of the docker-compose support (but no regression). Looks like a bug, but unfortunately, I personally can't work on this. However, if someone wants to pick that up, happy to help to integrate a PR for this. But it's probably not trivial as that kind of property replacement is 'special' and dmp and would need to be added to the compose support.