vscode+docker开发环境配置

  • vscode插件安装
    • Docker
    • Remote-Containers
    • Docker Compose
    • c/c++
    • c/c++ clang command adapter
    • c++ intellisense
    • CMake
    • CMake Tools
  • 系统软件安装
    • nvidia docker
    • docker compose
      • sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
        
      • sudo chmod +x /usr/local/bin/docker-compose
  • docker-compose.yml配置
    • version: "3"
      services:
        android_toolchain:
          image: eureca2020/ubuntu18.04:v1.3
          container_name:  toolchain
          tty: true
          volumes:
            - /home/eureca/code/test:/opt/project
  • task.json配置
    • {
          // See https://go.microsoft.com/fwlink/?LinkId=733558
          // for the documentation about the tasks.json format
          "version": "2.0.0",
          "tasks": [
              {
                  "label": "代码全量编译",
                  "type": "shell",
                  "command": "rm -r  build; mkdir build; cd build; cmake .. ; make",
                  "group": {
                      "kind": "build",
                      "isDefault": true
                  },
                  "problemMatcher": [
                      "$eslint-compact"
                  ]
              },
              {
                  "label": "代码增量编译",
                  "type": "shell",
                  "command": "cd build; cmake .. ; make",
                  "group": {
                      "kind": "build",
                      "isDefault": true
                  },
                  "problemMatcher": [
                      "$eslint-compact"
                  ]
              },
              {
                  "label": "make clean",
                  "type": "shell",
                  "command": "make clean",
                  "problemMatcher": [
                      "$eslint-compact"
                  ]
              }
          ]
      }
      
  • launch.json配置
    • {
          // 使用 IntelliSense 了解相关属性。 
          // 悬停以查看现有属性的描述。
          // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
          "version": "0.2.0",
          "configurations": [
              {
                  "name": "(gdb) Launch",
                  "type": "cppdbg",
                  "request": "launch",
                  "launchOptionType": "Local",
                  "targetArchitecture": "x86_64",
                  "program": "${workspaceFolder}/build/myModule", // 表示可执行程序所在的路径,其中,${workspaceRoot}表示VScode加载的文件夹的根目录
                  "args": [],
                  "stopAtEntry": true,
                  "cwd": "${workspaceFolder}",
                  "environment": [],
                  "MIMode": "gdb",
                  "setupCommands": [
                      {
                          "description": "Enable pretty-printing for gdb",
                          "text": "-enable-pretty-printing",
                          "ignoreFailures": true
                      }
                  ],
                  "preLaunchTask": "代码全量编译"
              }
          ]
      }
      
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值