createContainer method
Future<ContainerInfos?>
createContainer(
- String containerName,
- String imageName, {
- String? version,
- List<
String> ? ports, - String? network,
- String? hostname,
- Map<
String, String> ? environment, - Map<
String, String> ? volumes, - bool cleanContainer = false,
- String? healthCmd,
- Duration? healthInterval,
- int? healthRetries,
- Duration? healthStartPeriod,
- Duration? healthTimeout,
- String? restart,
Creates a Docker container with containerName
, image
and optional version
.
Implementation
Future<ContainerInfos?> createContainer(
String containerName,
String imageName, {
String? version,
List<String>? ports,
String? network,
String? hostname,
Map<String, String>? environment,
Map<String, String>? volumes,
bool cleanContainer = false,
String? healthCmd,
Duration? healthInterval,
int? healthRetries,
Duration? healthStartPeriod,
Duration? healthTimeout,
String? restart,
}) async {
await ensureInitialized();
return dockerHost.createContainer(
containerName,
imageName,
version: version,
ports: ports,
network: network,
hostname: hostname,
environment: environment,
volumes: volumes,
cleanContainer: cleanContainer,
healthCmd: healthCmd,
healthInterval: healthInterval,
healthRetries: healthRetries,
healthStartPeriod: healthStartPeriod,
healthTimeout: healthTimeout,
restart: restart,
);
}