Initial commit from https://devstar.cn/lat5211/base.git ( ed411359a0b35dccda674d15913e38a24a6d006b )
This commit is contained in:
18
.devcontainer/Dockerfile
Normal file
18
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM mcr.microsoft.com/devcontainers/base:dev-ubuntu-20.04
|
||||
|
||||
# 安装 build-essential 和调试工具
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
gdb \ # 添加GDB调试器
|
||||
gcc \
|
||||
make && \
|
||||
# 清理 apt 缓存
|
||||
apt-get autoremove -y && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /workspace
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
23
.devcontainer/devcontainer.json
Normal file
23
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "DevContainerExample",
|
||||
"image": "mcr.microsoft.com/devcontainers/base:dev-ubuntu-20.04",
|
||||
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y gdb && make",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"settings": {
|
||||
"debug.onTaskErrors": "debugAnyway"
|
||||
},
|
||||
"extensions": [
|
||||
"ms-vscode.cpptools"
|
||||
]
|
||||
}
|
||||
},
|
||||
"portsAttributes": {
|
||||
"3000": {
|
||||
"label": "Web Server",
|
||||
"onAutoForward": "notify"
|
||||
}
|
||||
},
|
||||
"initializeCommand": "gdb -ex 'set confirm off' -ex quit", // 初始化GDB配置
|
||||
"postAttachCommand": "make debug"
|
||||
}
|
||||
Reference in New Issue
Block a user