In my team we use Docker containers to locally run our website applications while we do development on them.
Assuming I\'m working on a Flask app at app.py
Just hit this problem and found a different workaround.
From getpass.py:
def getuser():
"""Get the username from the environment or password database.
First try various environment variables, then the password
database. This works on Windows as long as USERNAME is set.
"""
for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'):
user = os.environ.get(name)
if user:
return user
# If this fails, the exception will "explain" why
import pwd
return pwd.getpwuid(os.getuid())[0]
The call to getpwuid()
is only made if none of the following environment variables are set: LOGNAME
, USER
, LNAME
, USERNAME
Setting any of them should allow the container to start.
$ docker run -ti -e USER=someuser ...
In my case, the call to getuser()
seems to come from the Werkzeug library trying to generate a debugger pin code.