Hey there! I’m having trouble getting the docker_e...
# ask-community
m
Hey there! I’m having trouble getting the docker_executor to work in my test project. The project is largely based on the example docker deployment: https://github.com/dagster-io/dagster/tree/0.14.19/examples/deploy_docker. The project runs fine in a single docker container with the default executor, but I would to run each job step in a separate container. Simply specifying the docker executor_def in the job decorator is giving this error:
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
d
Hi Meder - my best guess is that the container that gets spun up for each run needs access to the Docker socket so that it can spin up a new container for each step. You should be able to fix this by including something like this in your run launcher configuration in the dagster.yaml file (note the last bit is different - that includes the same line that's in the docker-compose file to ensure that your containers can access the Docker socket to make calls against the Python Docker API):
Copy code
run_launcher:
  module: dagster_docker
  class: DockerRunLauncher
  config:
    env_vars:
      - DAGSTER_POSTGRES_USER
      - DAGSTER_POSTGRES_PASSWORD
      - DAGSTER_POSTGRES_DB
    network: docker_example_network
    container_kwargs:
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
We should probably include this in the example so that the docker_executor will work out of the box
@Dagster Bot docs include docker_executor example in the deploy_docker example
d
m
Thanks @daniel! That did it.
151 Views