barcodewhe.blogg.se

Pycharm docker
Pycharm docker







The command sets the workdir in the container to /usr/src/myapp so we can use relative paths. When you do this with your project, that should be your project directory. That command will mount the current directory into the container as /usr/src/myapp. Now, we can run the following Docker command: $ docker run -it -rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:3 python hello.py For simplicity, create a new folder, cd to it, and create a simple python script ( hello.py): #!/usr/bin/env python The best way to illustrate how this works is probably with an example. Instead, you should develop in P圜harm on your host machine, and use the container simply to run your python script. In this case, you do not want to run P圜harm from inside the Docker container. Using Docker as a way to manage python dependencies can also work well, and is a relatively new practice that is probably becoming more common. If you're unfamiliar with it and you want a simple way to manage python dependencies, you should read more about it since this might be the best solution. You need to be able to run a python script which your host machine does not have the dependencies for.Īs an aside, a common way to manage python dependencies is with virtualenv and virtualenvwrapper.









Pycharm docker