public class DockerContainer extends Object implements Closeable
| Constructor and Description |
|---|
DockerContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
assertRunning() |
void |
close()
Stops and remove any trace of the container
|
boolean |
cp(String from,
String toPath)
Copies a file or folder from inside the container to the outside.
|
String |
getCid() |
String |
getIpAddress()
IP address of this container reachable through the bridge.
|
File |
getLogfile() |
int |
getPid() |
com.fasterxml.jackson.databind.JsonNode |
inspect()
Provides details of this container.
|
String |
ipBound(int n)
Finds the ephemeral ip that the given container port is bind to.
|
int |
port(int n)
Finds the ephemeral port that the given container port is mapped to.
|
Resource |
resource(String relativePath)
By convention, docker fixtures put their resources into a sub-directory that has the same name as
the class name.
|
boolean |
sharingHostDockerService()
Support the case when ATHs are running in a docker container and
using the host docker service to spin "sibling" containers, as
described in http://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/
|
String |
toString() |
public void assertRunning()
public Resource resource(String relativePath)
public String getCid()
public File getLogfile()
public int getPid()
public String ipBound(int n)
public int port(int n)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic boolean cp(String from, String toPath)
from - the absolute path of the resource to copytoPath - the absolute path of the destination directorytrue if the copy was a success otherwise falsepublic com.fasterxml.jackson.databind.JsonNode inspect()
throws IOException
IOExceptionpublic String getIpAddress() throws IOException
IOExceptionpublic boolean sharingHostDockerService()
Copyright © 2004–2017. All rights reserved.