Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

docker-compose auto-detection brittle #153

Open
cjerdonek opened this issue Dec 12, 2015 · 6 comments
Open

docker-compose auto-detection brittle #153

cjerdonek opened this issue Dec 12, 2015 · 6 comments

Comments

@cjerdonek
Copy link

The documentation in the README says:

If you are using Docker Compose, docker-osx-dev will automatically sync
any folders marked as volumes in docker-compose.yml.

However, when I run docker-osx-dev from a directory that contains docker-compose.yml, it sometimes doesn't notice the file:

$ docker-osx-dev 
2015-12-11 20:22:07 [INFO] Using default sync paths: .

Looking at the code, I see why now:

# Parses out all volumes: entries from the docker-compose file

I had YAML comments in my file that broke the hacky parsing.

The lack of true support should be better documented to save people time.

@brikis98
Copy link
Owner

It is indeed hacky :)

To be fair, we haven't seen too many issues with it. What did your file look like? Is there any easy fix we could put in to take care of it?

Another simple improvement would be to log a warning if a docker-compose file is found, but no volumes are found within it.

@cjerdonek
Copy link
Author

Thanks, @brikis98. It looked something like this:

volumes:
  # comment
  # comment
  - <data>
  # comment
  # comment
  - <data>

I guess it wouldn't be too hard to recognize comments.

Yes, what would have helped me a lot is if the log message said something like:

[INFO] Using sync paths from Docker Compose file at docker-compose.yml: <none found>

Instead of:

[INFO] Using default sync paths: .

That way someone can know that the compose file was being found but just that no paths were parsed out.

@brikis98
Copy link
Owner

Both fixes seem useful. PRs are more than welcome :)

@cjerdonek
Copy link
Author

Okay, if I have time, I'll do it. :) By the way, I just noticed that if you pass explicit sync paths using the -s option, it still looks at your compose file. Is this intended? If not, is there a way to have the compose file be ignored?

@cjerdonek
Copy link
Author

(To clarify, it merges these lists, using both the explicitly passed sync paths in addition to what is in the compose file.)

@brikis98
Copy link
Owner

I don't think there is a parameter to specifically ignore the compose file, but you could just the compose file path with the -c parameter to a file that doesn't exist.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants