Hi, I'm trying too create a Prefect Docker Agent i...
# prefect-community
e
Hi, I'm trying too create a Prefect Docker Agent in a container passing the docker.sock to do some DinD Is there a way to mount volumes to the children spawned containers ? I tried to mount a volume when starting with --volume option but doesn't seems to work

https://puu.sh/J8fy5/f9869c73c7.png

Is it only available in prefect 2 like this ?
Copy code
DeploymentSpec(
    name="example",
    flow=docker_flow,
    flow_runner=DockerFlowRunner(
        image="prefecthq/prefect:2.0b6-python3.9",
        volumes=["/Users/anna/.aws:/root/.aws"],
    ),
)
https://discourse.prefect.io/t/how-to-bind-mount-a-volume-to-a-flow-run-container-for-e[…]unting-a-volume-with-aws-credentials-to-a-docker-agent/595
k
The attempt looks right here
Are you using the root user?
e
I think I forgot to split correctly the command in docker-compose yesterday however I still can't mount the volume on the container that runs the flow

https://puu.sh/J8opZ/4d63005761.png

@Kevin Kho
k
I think you are running into this ? This is just failing because of the Docker in Docker setup right? Does it work without Prefect if you create another container inside the container and mount something?
e
Yes I think I'm running into this issue