Class DockerService

java.lang.Object
io.github.bonigarcia.wdm.docker.DockerService

public class DockerService extends Object
Docker Service.
Since:
5.0.0
Author:
Boni Garcia
  • Field Details

  • Constructor Details

  • Method Details

    • getHost

      public String getHost(String containerId, String network)
    • isRunningInsideDocker

      public boolean isRunningInsideDocker()
    • getDefaultHost

      public String getDefaultHost()
    • getGateway

      public String getGateway(String containerId, String network)
    • getAddress

      public String getAddress(String containerId, String network)
    • startContainer

      public String startContainer(DockerContainer dockerContainer) throws com.github.dockerjava.api.exception.DockerException
      Throws:
      com.github.dockerjava.api.exception.DockerException
    • createDockerNetworkIfNotExists

      public void createDockerNetworkIfNotExists(String networkName)
    • execCommandInContainer

      public String execCommandInContainer(String containerId, String... command)
    • getOutputFromCmd

      public String getOutputFromCmd(com.github.dockerjava.api.command.AsyncDockerCmd<?,com.github.dockerjava.api.model.Frame> execStartCmd)
    • getBindPort

      public String getBindPort(String containerId, String exposed) throws com.github.dockerjava.api.exception.DockerException
      Throws:
      com.github.dockerjava.api.exception.DockerException
    • pullImageIfNecessary

      public void pullImageIfNecessary(String cacheKey, String imageId, String imageVersion) throws com.github.dockerjava.api.exception.DockerException
      Throws:
      com.github.dockerjava.api.exception.DockerException
    • stopAndRemoveContainer

      public void stopAndRemoveContainer(DockerContainer dockerContainer)
    • stopContainer

      public void stopContainer(String containerId) throws com.github.dockerjava.api.exception.DockerException
      Throws:
      com.github.dockerjava.api.exception.DockerException
    • removeContainer

      public void removeContainer(String containerId) throws com.github.dockerjava.api.exception.DockerException
      Throws:
      com.github.dockerjava.api.exception.DockerException
    • close

      public void close() throws IOException
      Throws:
      IOException
    • updateDockerClient

      public void updateDockerClient(String dockerHost)
    • getDockerImageVersion

      public String getDockerImageVersion(DriverManagerType driverManagerType, String cacheKey, String browserName, String browserVersion)
    • getCacheKey

      public static String getCacheKey(String browserName, String browserVersion)
    • getBrowserVersionFromContainer

      public String getBrowserVersionFromContainer(DriverManagerType driverManagerType, String cacheKey, String browserVersion, String dockerImage)
    • getMinusIndex

      public int getMinusIndex(String browserVersion)
    • getDockerImage

      public String getDockerImage(DriverManagerType driverManagerType, String browserName, String browserVersion)
    • getDockerImageFormat

      public String getDockerImageFormat()
    • isBrowserVersionWildCard

      public boolean isBrowserVersionWildCard(String browserVersion)
    • isBrowserVersionBetaOrDev

      public boolean isBrowserVersionBetaOrDev(String browserVersion)
    • isBrowserVersionLatestMinus

      public boolean isBrowserVersionLatestMinus(String browserVersion)
    • startNoVncContainer

      public DockerContainer startNoVncContainer(String dockerImage, String cacheKey, String browserVersion, DockerContainer browserContainer)
    • startBrowserContainer

      public DockerContainer startBrowserContainer(String dockerImage, String cacheKey, String browserVersion)
    • startRecorderContainer

      public DockerContainer startRecorderContainer(String dockerImage, String cacheKey, String recorderVersion, DockerContainer browserContainer)
    • getRecordingPath

      public Path getRecordingPath(DockerContainer browserContainer)
    • getVersionFromImage

      public String getVersionFromImage(String dockerImage)
    • getDockerClient

      public com.github.dockerjava.api.DockerClient getDockerClient()