Annotation Type DockerFixture


@Target(TYPE) @Retention(RUNTIME) @Indexed @Inherited public @interface DockerFixture
Annotates DockerContainer subtype that exposes fixture-specific methods.

The fixture should be accompanied by a Dockerfile resource in a predictable spot (see dockerfileFolder()). A fixture class may extend another fixture class. In this case the FROM directive should specify an image whose name is jenkins/ followed by the id() of the parent fixture; the tag is the first 12 characters of the sha1sum of the parent fixture’s Dockerfile. You will be able to see the tagged parent image names in your log.

Author:
Kohsuke Kawaguchi, asotobueno
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Unique ID of this fixture.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Deprecated.
    this assumes you have network knowledge of the running ATH environment which you can not possibly have.
    Path of Dockerfile file.
    boolean
    Map container ports to host ports exactly.
    int[]
    TCP ports that are exposed from this fixture.
    int[]
    UDP ports that are exposed from this fixture.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Field Details

  • Element Details

    • id

      String id
      Unique ID of this fixture. Used from cucumber, etc. to find this annotation.
    • ports

      int[] ports
      TCP ports that are exposed from this fixture.

      When a container is started, these ports from the container are mapped to random ephemeral ports on the host. The actual ephemeral port number can be retried at runtime via DockerContainer.port(int).

      Default:
      {}
    • udpPorts

      int[] udpPorts
      UDP ports that are exposed from this fixture.

      When a container is started, these ports from the container are mapped to random ephemeral ports on the host. The actual ephemeral port number can be retried at runtime via DockerContainer.udpPort(int).

      Default:
      {}
    • matchHostPorts

      boolean matchHostPorts
      Map container ports to host ports exactly.

      If true, no random ephemeral ports will be used, but an exact matching of container and host ports.

      Default:
      false
    • bindIp

      Deprecated.
      this assumes you have network knowledge of the running ATH environment which you can not possibly have. Docker may be running on a remote machine and as such any address (e.g. 127.0.0.5) you specify may not be reachable.
      Ip address to bind to
      Default:
      ""
    • dockerfileFolder

      String dockerfileFolder
      Path of Dockerfile file.

      By default Dockerfile fixture should be placed in the resource directory and at the same package as DockerContainer subtype.

      If this attribute is present, Dockerfile folder specified in the attribute is used as Dockerfile fixture place.

      Default:
      ""