public class DockerContainerServiceImpl extends Object implements DockerContainerService
| Constructor and Description |
|---|
DockerContainerServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Integer |
getHostPort(ProcessContext processContext,
Path dockerPath,
String containerName,
Integer containerPort,
Path workingDirectory,
Map<String,String> environment)
Gets the host port mapped to the given container port.
|
boolean |
isRunning(ProcessContext processContext,
Path dockerPath,
String containerName,
Path workingDirectory,
Map<String,String> environment)
Checks if a container with the given name is running.
|
void |
remove(ProcessContext processContext,
Path dockerPath,
String containerName,
Path workingDirectory,
Map<String,String> environment)
Removes the container with the given name.
|
void |
run(ProcessContext processContext,
Path dockerPath,
String imageName,
RunConfig runConfig,
Path workingDirectory,
Map<String,String> environment)
Start a Docker container for the image provided.
|
public static final String EQ_ARG
public void run(@NotNull
ProcessContext processContext,
@NotNull
Path dockerPath,
@NotNull
String imageName,
@NotNull
RunConfig runConfig,
@NotNull
Path workingDirectory,
@NotNull
Map<String,String> environment)
throws DockerException
DockerContainerServicerun in interface DockerContainerServiceimageName - the image to run.runConfig - The run configuration describing which parameters
to include for the Docker run command.DockerExceptionpublic boolean isRunning(@NotNull
ProcessContext processContext,
@NotNull
Path dockerPath,
@NotNull
String containerName,
@NotNull
Path workingDirectory,
@NotNull
Map<String,String> environment)
throws DockerException
DockerContainerServiceisRunning in interface DockerContainerServicecontainerName - the name of the container to check.DockerException@Nullable public Integer getHostPort(@NotNull ProcessContext processContext, @NotNull Path dockerPath, @NotNull String containerName, @NotNull Integer containerPort, @NotNull Path workingDirectory, @NotNull Map<String,String> environment) throws DockerException
DockerContainerServicegetHostPort in interface DockerContainerServicecontainerName - the name of the container to check.containerPort - The container port.DockerExceptionpublic void remove(@NotNull
ProcessContext processContext,
@NotNull
Path dockerPath,
@NotNull
String containerName,
@NotNull
Path workingDirectory,
@NotNull
Map<String,String> environment)
throws DockerException
DockerContainerServiceremove in interface DockerContainerServicecontainerName - the name of the container to remove.DockerExceptionCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.