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. Spring JUnit org.hibernate.HibernateException: Unable to get the default Bean Validation factory

    org.hibernate.HibernateException: Unable to get the default Bean Validation factory <property nam ...

  2. SQL注入与安全防护---以PHP为例

    一.什么是sql注入: 简单来说,当我们从前端的用户表单数据往后台数据库传输时,可能用户表单数据中的某些数据,会跟我们的后台发生“有机”反应,从而导致发生一些数据库的异常操作. 举个例子吧,以简单的用 ...

  3. git hooks 的学习使用

    示例网址: https://my.oschina.net/u/3477605/blog/1806238 https://www.jianshu.com/p/935409ce4c9a https://w ...

  4. Python VIL Realse

    #!/usr/bin/python #-*- coding:utf-8 –*- import os import sys import re import shutil import xlrd imp ...

  5. yaml语言教程

    大家直接去看阮一峰的教程. http://www.ruanyifeng.com/blog/2016/07/yaml.html?f=tt 简介 基本语法规则: 大小写敏感 使用缩进表示层级关系 缩进时不 ...

  6. java中如何制定自定义异常

    package gys; public class ExpetionTest { public static void main(String[] args) { NumberCheck n=new ...

  7. ubuntu 16.04安装Chrome离线crx插件包

    /opt/google/chrome/google-chrome --enable-easy-off-store-extension-install 打开浏览器后,输入chrome://extensi ...

  8. windows下手动安装pyinstaller(python2.7)

    1.首先,安装python2.7.13,官网下载msi版(windows直接安装): https://www.python.org/downloads/ 2.然后,到python包官网依次下载,fut ...

  9. python的接口

    写法一: class Payment: def pay(self, money): raise NotImplementedError class Alipay(Payment): def pay(s ...

  10. Richview 首页 奇偶页 不同页眉页脚

    首页 奇偶页 不同页眉页脚 ScaleRichView v6.0 Different headers and footers for the first page, for odd and even ...