Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Since I'm modifying docker-container package, I was able to fetch $.host.instance.floatingIpAddress and replace my placeholder text. The solution is actually:

Properties:
....
.....
extraopts:
   Contract: $.string()

Methods:
  initialize:
    Body:
    ....
      - $._address: $.host.instance.floatingIpAddress
      - $._extraOpts: str($.extraopts).replace("%FLOATINGIP%", str($._address))

Using this, I can pass --hostname %FLOATINGIP% to the docker container dynamically.

Since I'm modifying docker-container package, I was able to fetch $.host.instance.floatingIpAddress and replace my placeholder text. The solution is actually:

Properties:
....
.....
extraopts:
   Contract: $.string()

Methods:
  initialize:
    Body:
    ....
      - $._address: $.host.instance.floatingIpAddress
      - $._extraOpts: str($.extraopts).replace("%FLOATINGIP%", str($._address))

Using this, I can pass --hostname %FLOATINGIP% to the docker container dynamically.

The only quirk is that this package only works when deploying over Docker Standalone Hosts. If you deploy on a Kubernetes Pod, the deployment fails since it does not find "instance" object. Still looking for a solution.