Ask Your Question

[Murano] How to get the instance public IP address on container deployment

asked 2016-10-03 13:55:44 -0500

carlosedp gravatar image

I'm facing a problem where I'm trying to deploy a container (Gitlab in this case) where it expects a docker parameter with the instance's IP address (--hostname [IP]).

I've implemented some changes to docker-container, docker-interface-library and docker-standalone-host to support additional run parameters like --restart, etc. I'm trying to pass --hostname %HOST% and try to replace %HOST% with the public IP address but I saw that the $.ApplicationEndpoints is not created until the application is deployed but I need in the beginning of the process.

Is there any way to fetch the public IP from the docker host? Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-10-07 16:27:42 -0500

carlosedp gravatar image

updated 2017-03-13 14:03:06 -0500

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

   Contract: $.string()

      - $._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.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-10-03 13:55:44 -0500

Seen: 187 times

Last updated: Mar 13 '17