All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avast.gradle.dockercompose.ContainerInfo.groovy Maven / Gradle / Ivy

There is a newer version: 0.17.12
Show newest version
package com.avast.gradle.dockercompose

import groovy.transform.Immutable

//@Immutable // see ServiceHost.groovy
class ContainerInfo {
    /* For example serviceName_1 */
    String instanceName
    ServiceHost serviceHost
    /* Mapping from exposed to forwarded port. */
    Map tcpPorts
    Map udpPorts
    /* Docker inspection */
    Map inspection
    String getContainerId() { inspection.Id }
    String getContainerHostname() { inspection.Config.Hostname }

    String getHost() { serviceHost.host }
    Map getPorts() { tcpPorts }
    Integer getPort() { ports.values().find() }
    Integer getTcpPort() { tcpPorts.values().find() }
    Integer getUdpPort() { udpPorts.values().find() }


    @Override
    public String toString() {
        return "ContainerInfo{" +
                "instanceName='" + instanceName + '\'' +
                ", serviceHost=" + serviceHost +
                ", tcpPorts=" + tcpPorts +
                ", udpPorts=" + udpPorts +
                ", inspection=" + inspection +
                '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy