node.js - Change default run command of VSC Docker extension
问题描述
When right-clicking on an image in Microsoft's Docker plugin and selecting run
it executes the following command:
docker run --rm -d -p 3000:3000/tcp falaen:latest
I would like it to run the following command instead:
docker run --restart=always -v /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock -p 3000:3000 -d falaen
I have tried to modify the run command in the Dockerfile but without success. Of course, I can run the command manually in the terminal each time but it would be nicer to simply right click on the image and then run it.
解决方案
您可以尝试将此行添加到您的 VSCode 中settings.json
,以覆盖命令的默认配置。
"docker.commands.run": "docker run --restart=always -v /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock -p 3000:3000 -d ${tag}"
这将使用您选择的任何图像运行命令。
推荐阅读
- powershell - 根据属性计数将对象子集传递到管道中?
- python - 将图像中的像素迭代为 numpy 数组
- mysql - 如何在codeigniter的控制器中传递下拉列表值id
- python - 比较 MQTT 主题上先前和当前发布的值
- r - 当计数不是数据集中的列时,在 ggplot 中使用 expand_limits (R)
- c++ - 为 Win IoT Core 构建 ARM 会出现“不支持”错误
- cuda - 内核启动后,Nvidia 视觉分析器未显示 cudaMalloc()
- angular - 在 Angular/Symfony 应用程序中注册用户
- primeng-turbotable - Turbotable : p-tableHeaderCheckbox 选择禁用的行
- python - 多对多字段的 Django 表单上的逗号分隔文本而不是多项选择