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
DockerContainerService
run
in interface DockerContainerService
imageName
- the image to run.runConfig
- The run configuration describing which parameters
to include for the Docker run command.DockerException
public boolean isRunning(@NotNull ProcessContext processContext, @NotNull Path dockerPath, @NotNull String containerName, @NotNull Path workingDirectory, @NotNull Map<String,String> environment) throws DockerException
DockerContainerService
isRunning
in interface DockerContainerService
containerName
- 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
DockerContainerService
getHostPort
in interface DockerContainerService
containerName
- the name of the container to check.containerPort
- The container port.DockerException
public void remove(@NotNull ProcessContext processContext, @NotNull Path dockerPath, @NotNull String containerName, @NotNull Path workingDirectory, @NotNull Map<String,String> environment) throws DockerException
DockerContainerService
remove
in interface DockerContainerService
containerName
- the name of the container to remove.DockerException
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.