<#4374 [BUG] failed to connect to docker daemon wh...
# flyte-github
a
#4374 [BUG] failed to connect to docker daemon when building an ImageSpec for dynamic task Issue created by pryce-turner Describe the bug Running the following repro code on sandbox produces a docker daemon error.
Copy code
from flytekit import ImageSpec, task, dynamic

repro_img = ImageSpec(
    name="repro",
    apt_packages=["curl"],
    packages=["flytekitplugins-envd"],
    registry="localhost:30000",
)

@task(container_image=repro_img)
def foo():
    print("foo")

@dynamic(container_image=repro_img)
def bar():
    foo()
run via
pyflyte run --remote repro.py bar
produces:
Copy code
failed to run command envd build --path /tmp/flyteo_2xj3qe/local_flytekit/3380aff32c23bed8fb601083a1416478  --platform linux/amd64 --output type=image,name=localhost:30000/bowtie2:_7gw_tFHBpyC9hcIkTtvLg..,push=true with error b'error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?\n'
Expected behavior The execution should either fail earlier since specifying a container for dynamic tasks is likely inappropriate or should proceed through the workflow without issue. Additional context to reproduce No response Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte