docker.py uses wrong container name
MHuberFaust opened this issue · comments
Hi,
I freshly installed RaiseWikibase and could not use the scripts properly. After a while I found the problem:
Container names have hyphens in their name.
docker_names() in docker.py uses underscores instead if hyphens:
if names: names = [s.decode('ascii').replace('\n', '') for s in names] mysql = [k for k in names if '_mysql_' in k][0] wikibase = [k for k in names if '_wikibase_' in k][0]
adjusting the code to
if names: names = [s.decode('ascii').replace('\n', '') for s in names] mysql = [k for k in names if '-mysql-' in k][0] wikibase = [k for k in names if '-wikibase-' in k][0]
solved the issue.
It might be useful adjust the command from this issue as well: #4
Best,
Michael
Hi Michael, thank you for reporting this. I did test it with hyphens in Debian, it worked. Are you running it on Windows?
I run it on Mac.
Yeah, that's strange. No idea what's that. Since now it works as expected, I am closing the issue. Please reopen if it will repeat.
It happened again after a docker desktop update. Switching back to docker compose v1 did it for me.
here is a good explanation.
Since the latest versions of docker compose moved away from underscores it might be useful to adjust the code to fit both versions.
I see, thank you! I'll fix it now.