Daniel Lyons
09/11/2023, 10:14 PMdocker run --rm --mount type=bind,source=$SRC,target=$DEST -it thing:label arg1 arg2 …
? My gut feeling is that the DockerContainer
block should support this but I’m getting a feeling it is for another purpose than this, since I don’t see how to pass the arguments or mess around with the mountsNate
09/11/2023, 11:00 PMDockerContainer
for this
In [6]: from prefect.infrastructure.container import DockerContainer
...:
...: DockerContainer(
...: image="alpine:latest",
...: command=["echo", "Arguments received:", "arg1", "arg2"]
...: ).run()
17:57:38.209 | INFO | prefect.infrastructure.docker-container - Pulling image 'alpine:latest'...
17:57:39.756 | INFO | prefect.infrastructure.docker-container - Creating Docker container with auto-generated name...
17:57:39.789 | INFO | prefect.infrastructure.docker-container - Docker container 'brave_kalam' has status 'created'
17:57:40.003 | INFO | prefect.infrastructure.docker-container - Docker container 'brave_kalam' has status 'exited'
Arguments received: arg1 arg2
17:57:40.024 | INFO | prefect.infrastructure.docker-container - Docker container 'brave_kalam' has status 'exited'
Out[6]: DockerContainerResult(identifier='<http+docker://localhost:81>ce6a30ed4d5c27a0c9852e2703ae907b6a40fca6de16015364fa652f1df815', status_code=0)
where DockerContainer
should also accept `volumes` Daniel Lyons
09/11/2023, 11:01 PMmount
?