public class Container extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
LOCALSTACK_EXTERNAL_HOSTNAME |
| Modifier and Type | Method and Description |
|---|---|
static Container |
createLocalstackContainer(String externalHostName,
boolean pullNewImage,
boolean randomizePorts,
Map<String,String> environmentVariables)
It creates a container using the hostname given and the set of environment variables provided
|
String |
executeCommand(List<String> command)
Run a command on the container via docker exec
|
int |
getExternalPortFor(int internalPort)
Given an internal port, retrieve the publicly addressable port that maps to it
|
void |
stop()
Stop the container
|
void |
waitForAllPorts(String ip) |
void |
waitForLogToken(Pattern pattern)
Poll the docker logs until a specific token appears, then return.
|
public static final String LOCALSTACK_EXTERNAL_HOSTNAME
public static Container createLocalstackContainer(String externalHostName, boolean pullNewImage, boolean randomizePorts, Map<String,String> environmentVariables)
externalHostName - hostname to be used by localstackpullNewImage - determines if docker pull should be run to update to the latest image of the containerrandomizePorts - determines if the container should expose the default local stack ports or if it should expose randomized ports
in order to prevent conflicts with other localstack containers running on the same machineenvironmentVariables - map of environment variables to be passed to the docker containerpublic int getExternalPortFor(int internalPort)
public void waitForAllPorts(String ip)
public void waitForLogToken(Pattern pattern)
public void stop()
Copyright © 2018. All rights reserved.