admin管理员组文章数量:1315294
I want to utilize the VSCode launch configuration for Python debugpy
against a docker container process that exposes a dynamic port. The reason it exposes is a dynamic port is because we have multiple similar code bases that can run concurrently on a dev system and we want to avoid port conflict. The problem is I don't know how programmatically I can feed in a random port to this VSCode launch configuration process. Any advice here?
One strategy I was thinking about would be to generate the entire launch config as a hook after I spin up the service.
I haven't tried anything specific beyond looking through the documentation for a possible solution so far.
I want to utilize the VSCode launch configuration for Python debugpy
against a docker container process that exposes a dynamic port. The reason it exposes is a dynamic port is because we have multiple similar code bases that can run concurrently on a dev system and we want to avoid port conflict. The problem is I don't know how programmatically I can feed in a random port to this VSCode launch configuration process. Any advice here?
One strategy I was thinking about would be to generate the entire launch config as a hook after I spin up the service.
I haven't tried anything specific beyond looking through the documentation for a possible solution so far.
Share Improve this question asked Jan 31 at 6:05 user1985413user1985413 1 4- where is the random port number known. If you write it to a file you can use the extension I made Command Variable, there are different input formats – rioV8 Commented Jan 31 at 6:08
- it's known after a docker process launches and maps it, i suspect i'll have to do my own extension to get it from docker explicitly? thats a dope extension though you recommended, gotta keep my eye on that use case – user1985413 Commented Feb 11 at 0:31
- in the script that launches the docker image extract the port number and save it to a file – rioV8 Commented Feb 11 at 23:09
- Thanks @rioV8 you solved my problem friend! – user1985413 Commented Mar 4 at 0:11
1 Answer
Reset to default 0The short answer is no
you cannot do this natively in VSCode unless you leverage an extension.
本文标签: pythonIn launch configscan we feed in dynamic portsStack Overflow
版权声明:本文标题:python - In launch configs, can we feed in dynamic ports? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741924333a2405194.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论