Class WindowsDockerClient
- java.lang.Object
-
- org.jenkinsci.plugins.docker.workflow.client.DockerClient
-
- org.jenkinsci.plugins.docker.workflow.client.WindowsDockerClient
-
public class WindowsDockerClient extends DockerClient
-
-
Field Summary
-
Fields inherited from class org.jenkinsci.plugins.docker.workflow.client.DockerClient
CLIENT_TIMEOUT, DOCKER_DATE_TIME_FORMAT, SKIP_RM_ON_STOP
-
-
Constructor Summary
Constructors Constructor Description WindowsDockerClient(Launcher launcher, Node node, String toolName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.base.Optional<String>
getContainerIdIfContainerized()
Checks if thisDockerClient
instance is running inside a container and returns the id of the container if so.List<String>
listProcess(EnvVars launchEnv, String containerId)
String
run(EnvVars launchEnv, String image, String args, String workdir, Map<String,String> volumes, Collection<String> volumesFromContainers, EnvVars containerEnv, String user, String... command)
Run a docker image.String
whoAmI()
Who is executing thisDockerClient
instance.-
Methods inherited from class org.jenkinsci.plugins.docker.workflow.client.DockerClient
getContainerRecord, getVolumes, inspect, inspectRequiredField, parseVersionNumber, rm, stop, version
-
-
-
-
Method Detail
-
run
public String run(@NonNull EnvVars launchEnv, @NonNull String image, @CheckForNull String args, @CheckForNull String workdir, @NonNull Map<String,String> volumes, @NonNull Collection<String> volumesFromContainers, @NonNull EnvVars containerEnv, @NonNull String user, @NonNull String... command) throws IOException, InterruptedException
Description copied from class:DockerClient
Run a docker image.- Overrides:
run
in classDockerClient
- Parameters:
launchEnv
- Docker client launch environment.image
- The image name.args
- Any additional arguments for thedocker run
command.workdir
- The working directory in the container, ornull
for default.volumes
- Volumes to be bound. Supply an empty list if no volumes are to be bound.volumesFromContainers
- Mounts all volumes from the given containers.containerEnv
- Environment variables to set in container.user
- The uid:gid to execute the container command as. UseDockerClient.whoAmI()
.command
- The command to execute in the image container being run.- Returns:
- The container ID.
- Throws:
IOException
InterruptedException
-
listProcess
public List<String> listProcess(@NonNull EnvVars launchEnv, @NonNull String containerId) throws IOException, InterruptedException
- Overrides:
listProcess
in classDockerClient
- Throws:
IOException
InterruptedException
-
getContainerIdIfContainerized
public com.google.common.base.Optional<String> getContainerIdIfContainerized() throws IOException, InterruptedException
Description copied from class:DockerClient
Checks if thisDockerClient
instance is running inside a container and returns the id of the container if so.- Overrides:
getContainerIdIfContainerized
in classDockerClient
- Returns:
- an optional string containing the container id, or absent if it isn't containerized.
- Throws:
IOException
InterruptedException
- See Also:
- Discussion
-
whoAmI
public String whoAmI() throws IOException, InterruptedException
Description copied from class:DockerClient
Who is executing thisDockerClient
instance.- Overrides:
whoAmI
in classDockerClient
- Returns:
- a
String
containing the uid:gid. - Throws:
IOException
InterruptedException
-
-