pycharm can't complete remote interpreter setup for Docker

前端 未结 2 628
春和景丽
春和景丽 2021-02-02 18:28

I\'m new to Docker. I\'m using Docker & docker-compose, going through a flask tutorial. The base docker image is python 2.7 slim. It\'s running on Linux. docker 1.11.2 The

2条回答
  •  一整个雨季
    2021-02-02 18:29

    I - docker-compose up

    I think PyCharm will run docker-compose up, have you try to run this command first in your terminal (from where your docker-compose.yml is) ?

    Maybe if some errors occur, you will get more info in your terminal.

    II - pycharm docker configuration

    Otherwise it could be due to your docker machine configuration in PyCharm.

    What I do to configure my machine and to be sure this one is correctly configured:

    1 - run docker-machine ls in your shell

    2 - copy paste the url without tcp://

    3 - go to pycharm preferences -> Build, Execution, Deployement -> Docker -> + to create a new server, fill the server name field

    4 - paste previously copied url keeping https://

    5 - fill the path of your machine certificates folder

    6 - tick Import credentials from Docker Machine

    7 - click Detect -> your machine should appear in the selection list

    8 - save this server

    9 - select this server when configuring your remote interpreter, from PyCharm Preferences -> Project -> Project Interpreter -> wheel -> add remote -> Docker or Docker Compose

    10 - you should be able to select a service name

    11 - save your new interpreter

    11 - try run your test twice, sometimes it could take time to initialize

提交回复
热议问题