Annotation Type HostPort


@Target({FIELD,PARAMETER}) @Retention(RUNTIME) @Documented public @interface HostPort
HostPort annotation is used to inject the bound port to a container object. Typically a docker image has an exposed port which is bound to a binding port (to access from outside). With this annotation you set the exposed port, and Cube will inject the bind port associated to this exposed port.

For example given: 2222->22/tcp and using:

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Sets the cube name where you want to get the exposed port.
    int
     
  • Element Details

    • containerName

      String containerName
      Sets the cube name where you want to get the exposed port. Only useful in case of not using Container Object pattern.
      Returns:
      Cube Name
      Default:
      ""
    • value

      int value
      Default:
      0