https://prefect.io logo
#prefect-community
Title
# prefect-community
e

Elio

06/27/2022, 2:19 PM
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

Kevin Kho

06/27/2022, 3:38 PM
The attempt looks right here
Are you using the root user?
e

Elio

06/28/2022, 8:38 AM
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

Kevin Kho

06/29/2022, 4:30 PM
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

Elio

07/05/2022, 2:06 PM
Yes I think I'm running into this issue
16 Views