简体   繁体   English

从本地主机访问AWS中的Docker容器

[英]Accessing docker container in AWS from localhost

I have a python docker container up and running on EC2-instance. 我有一个Python docker容器并在EC2-instance上运行。 How can I use this python as interpreter in my local IDE (PyCharm)? 如何在本地IDE(PyCharm)中使用此python作为解释器?

Go to File -> Settings 转到文件->设置

Then Project -> Project Interpreter 然后Project-> Project Interpreter

在此处输入图片说明

Then on top right on the gear icon, click 'Add'. 然后在齿轮图标的右上角,单击“添加”。

在此处输入图片说明

Then go to SSH interpreter, fill in the Host IP of your EC2-instance and the username. 然后转到SSH解释器,填写您的EC2实例的主机IP和用户名。

在此处输入图片说明

Next, fill the password or add your private key (this assumes you have the right for SSH into the instance) 接下来,填写密码或添加您的私钥(这假设您有权将SSH进入实例)

在此处输入图片说明

Finally, choose the python interpreter in the remote instance. 最后,在远程实例中选择python解释器。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM