docker run pypiserver error
TalentedBastard opened this issue · comments
I use docker part in readme to start my pypiserver, however, an exception occurred, it Shows that there is no file named htpasswd.txt, but my dir has this file
command :
- pip install passlib and htpasswd -sc htpasswd.txt <some_username>
- docker run -p 30011:8080 -v ./htpasswd:/data/.htpasswd pypiserver/pypiserver:latest run -P ./htpasswd.txt ./packages
Hello @TalentedBastard! Thanks for submitting the issue and adding the screenshots 👍 If I read it correctly, I'd double check the volume mapping of htpasswd
to the docker container and its eventual use as an argument.
When passing the start-up arguments in docker, as in here:
pypiserver/pypiserver:latest run -P <HTTPASSWORD_FILE> <PACKAGES_DIR>
Both <HTTPASSWORD_FILE>
and <PACKAGES_DIR>
should be relative to the files available within the container. So in your case, <HTTPASSWORD_FILE>
should point to the password file you've added to /data/.htpasswd
with -v ./htpasswd:/data/.htpasswd
. And the <PACKAGES_DIR>
being set to ./packages
should be fine IMO because it will pick it up as a local directory 😇
So all in all, I think the error you get is that <HTTPASSWORD_FILE>
set to ./htpasswd.txt
is indeed not existing on the container 🔍 Could you double check if this helps if you make sure you use explicit (or full) container-relative file paths? Let me know if it works, if not I'll be happy to look deeper ✌️