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