Class DockerContainer

    • Constructor Detail

      • DockerContainer

        public DockerContainer()
    • Method Detail

      • assertRunning

        public void assertRunning()
      • resource

        public Resource resource​(String relativePath)
        By convention, docker fixtures put their resources into a sub-directory that has the same name as the class name.
      • getCid

        public String getCid()
      • getLogfile

        public File getLogfile()
      • getPid

        public long getPid()
      • ipBound

        public String ipBound​(int n)
        Finds the ephemeral ip that the given container TCP port is bind to.
      • ipUdpBound

        public String ipUdpBound​(int n)
        Finds the ephemeral ip that the given container UDP port is bind to.
      • port

        public int port​(int n)
        Finds the ephemeral port that the given container port is mapped to.
      • udpPort

        public int udpPort​(int n)
        Finds the ephemeral UDP port that the given container port is mapped to.
      • close

        public void close()
        Stops and remove any trace of the container
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
      • cp

        @Deprecated
        public boolean cp​(String from,
                          String toPath)
        Deprecated.
        do not call inside container. File ownership does not work the same way for copying from one docker container to another, see https://forums.docker.com/t/can-docker-cp-set-user-id-and-group/21562
        Copies a file or folder from inside the container to the outside. Silently overwrites an existing file.
        Parameters:
        from - the absolute path of the resource to copy
        toPath - the absolute path of the destination directory
        Returns:
        true if the copy was a success otherwise false
      • inspect

        public com.fasterxml.jackson.databind.JsonNode inspect()
                                                        throws IOException
        Provides details of this container.
        Throws:
        IOException
      • getIpAddress

        public String getIpAddress()
                            throws IOException
        IP address of this container reachable through the bridge.
        Throws:
        IOException
      • sharingHostDockerService

        public boolean sharingHostDockerService()
        Support the case when ATHs are running in a docker container and using the host docker service to spin "sibling" containers, as described in http://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/
      • ipv6Enabled

        public static boolean ipv6Enabled()