运行 docker 使用 fabric8 maven 插件的带有外部配置文件的图像

Run docker image with external configuration file with fabric8 maven plugin

我正在尝试使用 Maven 运行 elasticmq 而不是 docker。您可以在下面找到我对 docker 的配置。在 /src/main/resources/container/sqs/config 文件夹下,我将自定义队列配置名称设置为 elasticmq.conf

<image>
    <alias>elastic-mq</alias>
    <name>s12v/elasticmq</name>
    <run>
        <ports>${elasticmq.port}:9324</ports>
        <volumes>
            <bind>
                <volume>${project.basedir}/src/main/resources/container/sqs/config/elasticmq.conf:/etc/elasticmq/elasticmq.conf</volume>
            </bind>
        </volumes>
    </run>
    <wait>
        <tcp>
            <host>127.0.0.1</host>
            <ports>
                <port>9324</port>
            </ports>
        </tcp>
    </wait>
</image>

当我 运行 我收到这个错误:

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.22.1:build (start) on project xxx-xxx-xxx: Unable to parse configuration of mojo io.fabric8:docker-maven-plugin:0.22.1:build for parameter wait: Cannot find 'wait' in class io.fabric8.maven.docker.config.ImageConfiguration -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :xxx-xxx-xxx

有没有人可以解决这个问题或如何正确配置?

固定如下,顺便说一句,我决定使用另一个 docker 关于 ElasticMQ 的图像。

<image>
    <alias>elastic-mq</alias>
    <name>softwaremill/elasticmq:0.14.6</name>
    <run>
        <ports>
            <port>9324:9324</port>
        </ports>
        <volumes>
            <bind>
                <volume>${project.basedir}/src/main/resources/container/sqs/config/elasticmq.conf:/opt/elasticmq.conf</volume>
            </bind>
        </volumes>
    </run>
</image>

根据文档,您的 <wait> 元素应该在 <run> 元素。像这样:

<image>
  <alias>elastic-mq</alias>
  <name>s12v/elasticmq</name>
  <run>
    <ports>${elasticmq.port}:9324</ports>
    <volumes>
      <bind>
        <volume>${project.basedir}/src/main/resources/container/sqs/config/elasticmq.conf:/etc/elasticmq/elasticmq.conf</volume>
      </bind>
    </volumes>
    <wait>
      <tcp>
        <host>127.0.0.1</host>
        <ports>
          <port>9324</port>
        </ports>
      </tcp>
    </wait>
  </run>
</image>