Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volumes not work on windows #126

Open
Jacobliu8 opened this issue Jan 12, 2022 · 2 comments
Open

volumes not work on windows #126

Jacobliu8 opened this issue Jan 12, 2022 · 2 comments

Comments

@Jacobliu8
Copy link

when I try to start mysql for a test. I try to export the data to my local disk

[docker:mysql]
image = mysql:8.0
healthcheck_cmd = mysql -uroot -D information_schema -e "SELECT * FROM plugins LIMIT 1;"
healthcheck_interval = 30
healthcheck_timeout = 10
healthcheck_retries = 20
environment =
MYSQL_ALLOW_EMPTY_PASSWORD=true
ports =
10232:3306/tcp
volumes =
bind:rw:{toxinidir}/testdata:/var/lib/mysql

but the validation not pass due to the

 parts = volume_line.split(":")
 if len(parts) != 4:
        raise ValueError(f"Volume {volume_line!r} is malformed")

My pc is window system.
Maybe a bug for windows because window path will like 'D:\githome\xx\' contains : then the parts len should be 5 rather then 4

@dcrosta
Copy link
Member

dcrosta commented Jan 17, 2022

I don't have a windows machine to test with, but I wonder if using a UNC path might work. Could you try replacing bind:rw:{toxinidir}/testdata:/var/lib/mysql with eg bind:rw:\\.\UNC\LOCALHOST\c$\githome\xx\testdata:/var/lib/mysql (with the correct path that you want)?

If that works ... I'm still not sure what the right fix is here, since {toxinidir} doesn't seem to be giving you a UNC path, but at least that might point us in a working direction...

@amdokamal
Copy link

bind:rw:\.\UNC\LOCALHOST\c$ path does not work, docker.errors.APIError: 500 Server Error for (...) (EXTRA string=is not a valid Windows path)'")

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

No branches or pull requests

3 participants