Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cant not work on WSL2 #1122

Unanswered
achaosss asked this question in Questions
Discussion options

First Check

  • I added a very descriptive title here.
  • I used the GitHub search to find a similar question and didn't find it.
  • I searched in the documentation/README.
  • I already searched in Google "How to do X" and didn't find any information.
  • I already read and followed all the tutorial in the docs/README and didn't find an answer.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

I use WLS2 to build the project, which can't access http://localhost/login and localhost:8888

Description

root@ZHS-154006054:/mnt/c/workshop/开发功能测试/full-stack-fastapi-template/my-awesome-project# docker compose logs backend
WARN[0000] /mnt/c/workshop/开发功能测试/full-stack-fastapi-template/my-awesome-project/docker-compose.yml: version is obsolete
WARN[0000] /mnt/c/workshop/开发功能测试/full-stack-fastapi-template/my-awesome-project/docker-compose.override.yml: version is obsolete
backend-1 | Checking for script in /app/prestart.sh
backend-1 | Running script /app/prestart.sh
backend-1 | INFO:main:Initializing service
backend-1 | INFO:main:Starting call to 'main.init', this is the 1st time calling it.
backend-1 | INFO:main:Service finished initializing
backend-1 | INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
backend-1 | INFO [alembic.runtime.migration] Will assume transactional DDL.
backend-1 | INFO [alembic.runtime.migration] Running upgrade -> e2412789c190, Initialize models
backend-1 | INFO:main:Creating initial data
backend-1 | INFO:main:Initial data created
backend-1 | INFO: Will watch for changes in these directories: ['/app']
backend-1 | INFO: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
backend-1 | INFO: Started reloader process [1] using WatchFiles
backend-1 | INFO: Started server process [11]
backend-1 | INFO: Waiting for application startup.
backend-1 | INFO: Application startup complete.
image

Operating System

Windows

Operating System Details

Linux version 5.10.16.3-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Apr 2 22:23:49 UTC 2021

Python Version

3.8

Additional Context

No response

You must be logged in to vote

Replies: 2 comments

Comment options

@achaosss sometime, the localhost of WSL2 and your Windows are not align.
To discover the real localhost IP of you WSL2, try tu run this inside WSL2):

ip addr

And look for eth0

Also you can try to access to the Docker IP directly with:

docker inspect
You must be logged in to vote
0 replies
Comment options

@achaosss, was the answer helpful? Could you share how you solved the problem?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested

AltStyle によって変換されたページ (->オリジナル) /