Debug with docker in pycharm

Why

As I really really appreciate it that we can have a isolated develop environment, when I heard pycharm can debug with docker, I was more than happy. However, things are not that easy.

What I got

I tried, tried and tried. At an amzing monment I succeeded running docker on windows throgh DockerToolbox. Mostly, I refer One answer to Running a Docker image in PyCharm causes “Invalid volume specification”.(By the way, my machine and environment is exactly like the answer)

BUT suddenly I failed to repeat it.

So I changed to try it on ubuntu

Unbuntu 14.04 in virtualbox.

The default settings when add docker as shown below is not suitable for unbuntu 14.

According to another SO question's answer, adding unix:///var/run/docker.sock to the API URL shows Connection successful when click Apply. But when running programs it still won't work.

And then

Problem partially solved, when we use docker to debug our project throgh PyCharm, it's not attach to a running docker and/or exec the commands (by now). Instead it start a new Containner and run the commands, so if we want to debug a python file, we should make sure the docker running python when open.

In other word, the Dockerfile better with last sentence:

CMD ["python3"]

And in linux (ubuntu) when this assured, all things is OK. And now I can debug with alpine-python

TODO

After succeeded in linux, I go back and try in windows, it's surely a bug of pycharm and hope can be solved in latter version.

And what's more, what I really want is more than this, I hope as below:


+------------------------------+
| | +------------------+ +-------------------+
| | <----------------+ | | |
| Docker/rkt/others | | Desktop UI XXXXXX Happy ME |
| +----------------> | | | |
| | +------------------+ +-------------------+
+------------------------------+
Some remote servers

In other word, no applications on PC/Desktop, no more reinstall systems, no different configurations, no more configurations problems! But with full control of what we use.

I will review related techs in the future, and this is another weekend I spent play with docker and all the configurations and DIT NOTHING WORTHFUL. Well, that's typical me. -.-

Debug_with_docker_in_pycharm的更多相关文章

随机推荐

  1. ORA-09817: Write to audit file failed 的解决

    今天在进行awr报表导出时,用sys as sysdba 登录,不能connect,报ORA-09817: Write to audit file failed 错误,是系统空间不足的报警.df -l ...

  2. (判断)window.open()窗口被关闭后执行事件

    $(function() { // start ready var $article_share=$('#body .article').find('li.share'); // $article_s ...

  3. 关于正则表达式 C#

    读懂正则表达式就这么简单   一 前言 对于正则表达式,相信很多人都知道,但是很多人的第一感觉就是难学,因为看第一眼时,觉得完全没有规律可寻,而且全是一堆各种各样的特殊符号,完全不知所云. 其实只是对 ...

  4. php soap实例讲解

    一,什么是soap,什么是wsdl,为什么要用他们 SOAP是基于XML和HTTP通信协议,xml各种平台,各种语言都支持的一个种语言.http呢它得到了所有的因特网浏览器及服务器的支持. WSDL ...

  5. CFGym 101505I 题解

    一.题目链接 http://codeforces.com/gym/101505 二.题意 这题其实主要就是题意,理解题意后,就是水题了.我想了下,主要原因就是这几点: 1.题意太过英文化,很多句子不能 ...

  6. jQuery操作table tr td

    1.鼠标移动行变色 $("#tab tr").hover(function(){ $(this).children("td").addClass("h ...

  7. 32_java之TCP和UDP

    01网络模型 *A:网络模型 TCP/IP协议中的四层分别是应用层.传输层.网络层和链路层,每层分别负责不同的通信功能,接下来针对这四层进行详细地讲解. 链路层:链路层是用于定义物理传输通道,通常是对 ...

  8. Pyhton项目实践:将带有美国风格日期的文件改名为欧洲风格日期

    题目 项目要求:上千个文本文件,文件名包含美国风格的日期( MM-DD-YYYY),需要将它们改名为欧洲风格的日期( DD-MM-YYYY) 先写个创建一百个美国风格日期的文件 #! python # ...

  9. <form> 表单提交 return 阻止内容为空事件

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. zk分布式锁-排它锁简单实现-优化版

    package Lock; import java.util.Collection;import java.util.Collections;import java.util.List;import ...