Passing arguments to Docker when using remote python interpreter within docker

My setting


MacOS, pycharm 2019.3.2.

I have a remote server -- CentOS 7 -- and I want to run docker in the server and use the remote interpreter there. I have followed the guide here: and it works like charm! However, a problem is that I need to pass an argument "--ipc=host" to "docker run" like this: "docker run ... --ipc=host ... "

How would I do this? I've tried: but it seems like setting command line options there doesn't help when I want to set command line options when I'm using the interpreter within the docker.


Dockerfile seems to be working with remote interpreters, so you can use Dockerfile configuration instead of Python configuration, and specify run options there:



Currently, I have my remote interpreter set up this way. How would use the interpreter in the docker with the option you suggested above?


Basically when you run this configuration, PyCharm spins up the container, mounts your local project to directory inside the container, and executes the script using remote command.

You can do the same using Dockerfile: 

1. Create a Dockerfile with instruction to COPY the script to a WORKDIR inside container, install dependencies if necessary and run the copied script with CMD instruction

2. When you run this Dockerfile in PyCharm, it will build the image on your remote host and run it there, providing output in your local instance of PyCharm.


Hi, did you have any luck with this. I am also going to the same path but a bit lost.


Please sign in to leave a comment.