marios
09/01/2021, 2:41 PMKevin Kho
docker-py and mounts are done in 2 parts. First is the host_config and second is the volumes. It looks like this:
client.api.create_container(
'busybox', 'ls', volumes=['/mnt/vol1', '/mnt/vol2'],
host_config=client.api.create_host_config(binds=[
'/home/user1/:/mnt/vol2',
'/var/www:/mnt/vol1:ro',
])
)
The DockerRun run configuration from Prefect lets you pass in a host config, so that part is fine, but it still needs to be added in the volumes , which comes from the agent unfortunately.
This might be worth opening a ticket for and seeing if we can pass volumes through the RunConfig as well. I’ll dig in if this is feasible.marios
09/01/2021, 3:06 PMKevin Kho
Marvin
09/25/2021, 1:58 AM