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. Linux 解压zip need PK compat. v4.5 (can do v2.1)

    p7z 当使用7zip压缩大于4G的文件后,在linux下解压时,出现下面的提示,无法解压: [root@localhost root]# unzip Wrestlemania20.zip Archi ...

  2. myeclipse修改内存大小不足

    工具中修改设置Default VM Arguments   1 打开MyEclipse,如下图所示 2 打开Windows-> Preferences 3 然后选择右侧菜单的Java->I ...

  3. 在laravel之外使用eloquent

    视频地址 https://laracasts.com/lessons/how-to-use-eloquent-outside-of-laravel

  4. 关于 android百度地图 调用 地理位置 经纬度坐标,只调用一次的解决方法,通知栏不总是 搜索 GPS 。。。

    上代码吧... //读取当前坐标 final LocationClient mLocationClient = new LocationClient(mActivity); mLocationClie ...

  5. sqlserver基础操作

    启动服务: 1.在系统服务启动 2.在sql配置管理器服务选项中启动 3.在管理员cmd:net start mssqlserver;net stop mssqlserver use master g ...

  6. Autofac框架详解

    一.组件 创建出来的对象需要从组件中来获取,组件的创建有如下4种(延续第一篇的Demo,仅仅变动所贴出的代码)方式: 1.类型创建RegisterType AutoFac能够通过反射检查一个类型,选择 ...

  7. SpringBoot Session 管理及集群管理

    1.配置session的超时时间 : 在application.prooperties中 server.session.timeout = 600       //以秒为单位,默认最少一分钟 2.配置 ...

  8. leetcode532

    public class Solution { public int FindPairs(int[] nums, int k) { var pair = new Dictionary<strin ...

  9. vba截屏保存

    Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVa ...

  10. 跟我学算法- tensorflow模型的保存与读取 tf.train.Saver()

    save =  tf.train.Saver() 通过save. save() 实现数据的加载 通过save.restore() 实现数据的导出 第一步: 数据的载入 import tensorflo ...