Home > Software design >  How do you specify a direct path volume in docker-compose.yml?
How do you specify a direct path volume in docker-compose.yml?

Time:06-29

I am trying to sync a directory on my local machine to a docker container. I want to be able to read and modify a directory on my local machine from a docker container and those changes be seen on the local machine. Adding a relative path in the volumes section of the docker-compose.yml file works, but a direct path does not. Here is what I have

volumes:
      - ../../logs:/opt/airflow/logs

but what I want to do is

volumes:
     - /Users/bob/airflow/logs:/opt/airflow/logs

CodePudding user response:

Go to your logs directory on your local machine and pwd to see if you have mistyped the absolute path.

  • Related