forked from templates/base
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 23a9c87287 | |||
| 76c53e83d1 | |||
| 81cf13d762 | |||
| 027639c9c3 | |||
| 327e52c994 | |||
| c970262982 | |||
| 58d7bdd03f | |||
| 0400452c77 | |||
| b247f1133f | |||
| 2df7d32f97 |
@@ -1,18 +0,0 @@
|
||||
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"]
|
||||
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"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",
|
||||
"ms-azuretools.vscode-docker"
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
"portsAttributes": {
|
||||
"3000": {
|
||||
"label": "Web Server",
|
||||
"onAutoForward": "notify"
|
||||
}
|
||||
},
|
||||
"initializeCommand": "gdb -ex 'set confirm off' -ex quit", // 初始化GDB配置
|
||||
"postAttachCommand": "make debug"
|
||||
}
|
||||
13
.devstar/Dockerfile.alpine-latest
Normal file
13
.devstar/Dockerfile.alpine-latest
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM docker.io/library/alpine:latest
|
||||
|
||||
# 安装开发工具(合并RUN层,减少镜像大小)
|
||||
RUN apk add --no-cache \
|
||||
build-base \
|
||||
openssh-server openssh-keygen openssh-client \
|
||||
openrc \
|
||||
git \
|
||||
bash \
|
||||
curl \
|
||||
ca-certificates \
|
||||
&& update-ca-certificates \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
10
.devstar/Dockerfile.ubuntu-latest
Normal file
10
.devstar/Dockerfile.ubuntu-latest
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM docker.io/library/ubuntu:latest
|
||||
|
||||
# 安装开发工具(合并RUN层,减少镜像大小)
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential gdb git\
|
||||
openssh-server \
|
||||
bash sudo \
|
||||
curl wget \
|
||||
ca-certificates \
|
||||
apt remove --purge curl -y && apt autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
25
.devstar/devcontainer.json
Normal file
25
.devstar/devcontainer.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "DevContainerExample",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile.ubuntu-latest"
|
||||
},
|
||||
"forwardPorts": [
|
||||
"8080"
|
||||
],
|
||||
"initializeCommand": "echo \"initializeCommand\";",
|
||||
"onCreateCommand": [
|
||||
"echo \"onCreateCommand\";",
|
||||
"echo \"onCreateCommand\";"
|
||||
],
|
||||
"postCreateCommand": [
|
||||
"echo \"postCreateCommand\"",
|
||||
"echo \"OK\""
|
||||
],
|
||||
"postAttachCommand": [
|
||||
"echo \"postAttachCommand\"",
|
||||
"echo \"OK\""
|
||||
],
|
||||
"runArgs": [
|
||||
"-p 8888"
|
||||
]
|
||||
}
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🔍 Check out repository code
|
||||
uses: https://devstar.cn/actions/checkout@v4
|
||||
uses: actions/checkout@v4
|
||||
- name: 🔧 Test Codes and Build an Artifact
|
||||
run: |
|
||||
set -e # 任何命令失败都停止执行
|
||||
Reference in New Issue
Block a user