Add volumes and ports to docker-container recipe
This commit is contained in:
parent
81fcc339d3
commit
d1d196821f
@ -20,6 +20,8 @@ class DockerContainer(Recipe):
|
|||||||
self.image = check_type(args.get("image"), str)
|
self.image = check_type(args.get("image"), str)
|
||||||
self.command = check_type(args.get("command"), str)
|
self.command = check_type(args.get("command"), str)
|
||||||
self.name = check_type(args.get("name"), str)
|
self.name = check_type(args.get("name"), str)
|
||||||
|
self.volumes = check_type_opt(args.get("volumes"), dict)
|
||||||
|
self.ports = check_type_opt(args.get("ports"), dict)
|
||||||
|
|
||||||
async def cook(self, kitchen: Kitchen) -> None:
|
async def cook(self, kitchen: Kitchen) -> None:
|
||||||
kitchen.get_dependency_tracker()
|
kitchen.get_dependency_tracker()
|
||||||
@ -28,7 +30,13 @@ class DockerContainer(Recipe):
|
|||||||
|
|
||||||
if current_state == ContainerState.NOTFOUND:
|
if current_state == ContainerState.NOTFOUND:
|
||||||
await kitchen.ut1areq(
|
await kitchen.ut1areq(
|
||||||
DockerContainerRun(self.image, self.command, self.name),
|
DockerContainerRun(
|
||||||
|
self.image,
|
||||||
|
self.command,
|
||||||
|
self.name,
|
||||||
|
self.ports or dict(),
|
||||||
|
self.volumes or dict(),
|
||||||
|
),
|
||||||
DockerContainerRun.Result,
|
DockerContainerRun.Result,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user