Docker utilities.
- Source:
Example
const { docker } = require('dev-env-lib');
Methods
(static) buildImage(name, dockerfilePath) → {Promise.<cp~AggregatedOutput>}
Build docker image.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of docker image |
dockerfilePath |
cp~PathSegments | Absolute or relative (to workingDirectory) path to Dockerfile |
- Source:
Returns:
aggregated output
- Type
- Promise.<cp~AggregatedOutput>
(static) createNetwork(name) → {Promise.<cp~AggregatedOutput>}
Create a virtual network with docker.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of docker image |
- Source:
Returns:
aggregated output
- Type
- Promise.<cp~AggregatedOutput>
(static) imageExists(name) → {Promise.<boolean>}
Check if a docker image already exists.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of docker image |
- Source:
Returns:
existance of docker image
- Type
- Promise.<boolean>
(static) removeContainer(name) → {Promise.<cp~AggregatedOutput>}
Remove a docker container.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of docker container |
- Source:
Returns:
aggregated output
- Type
- Promise.<cp~AggregatedOutput>
(static) removeImage(name) → {cp~AggregatedOutput}
Remove docker image.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of docker image |
- Source:
Returns:
aggregated output
- Type
- cp~AggregatedOutput
(static) removeNetwork(name) → {Promise.<cp~AggregatedOutput>}
Remove a virtual network with docker.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of docker image |
- Source:
Returns:
aggregated output
- Type
- Promise.<cp~AggregatedOutput>
(static) waitForContainerOutput(name, regex) → {Promise}
Tail the logs of a container until output matches the given regex.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of docker container |
regex |
RegExp | regex to match in output |
- Source:
Returns:
fulfill on match, reject when process closed without match
- Type
- Promise