Add Devcontainers and Docker Environment
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
FROM mcr.microsoft.com/devcontainers/base:dev-ubuntu22.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
TZ=Asia/Shanghai \
|
||||
LANG=C.UTF-8
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git ssh make gcc g++ gcc-multilib g++-multilib \
|
||||
module-assistant expect gawk texinfo libssl-dev \
|
||||
bison flex fakeroot cmake unzip gperf autoconf \
|
||||
device-tree-compiler libncurses5-dev pkg-config bc \
|
||||
python-is-python3 openssl openssh-server openssh-client \
|
||||
vim file cpio rsync curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /workspace
|
||||
CMD ["/bin/bash"]
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"features": {
|
||||
"ghcr.io/danzilberdan/devcontainers/opencode:0": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "ghcr.io/danzilberdan/devcontainers/opencode@sha256:e43ac479f99686e96b77dd27edfb5004b922bca3049dc2995c450177bda3bcb9",
|
||||
"integrity": "sha256:e43ac479f99686e96b77dd27edfb5004b922bca3049dc2995c450177bda3bcb9"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
|
||||
"name": "Luckfox Pico",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile", // Dockerfile 的文件名
|
||||
"context": "..", // 构建上下文(推荐使用项目根目录)
|
||||
"args": { // 可选:传递构建参数
|
||||
"NODE_VERSION": "20"
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"ghcr.io/danzilberdan/devcontainers/opencode:0": {}
|
||||
},
|
||||
"mounts": [
|
||||
// 挂载本机全局配置(推荐只挂载 config 目录)
|
||||
{
|
||||
"source": "${localEnv:HOME}/.config/opencode",
|
||||
"target": "/root/.config/opencode",
|
||||
"type": "bind"
|
||||
},
|
||||
// 挂载认证凭证(最安全的做法)
|
||||
{
|
||||
"source": "${localEnv:HOME}/.local/share/opencode/auth.json",
|
||||
"target": "/root/.local/share/opencode/auth.json",
|
||||
"type": "bind"
|
||||
}
|
||||
],
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"opencode.opencode-vscode",
|
||||
"codeinchinese.englishchinesedictionary",
|
||||
"ms-vscode.cpptools-extension-pack",
|
||||
"ms-vscode.cmake-tools",
|
||||
"ms-azuretools.vscode-containers",
|
||||
"cschlosser.doxdocgen",
|
||||
"oderwat.indent-rainbow"
|
||||
]
|
||||
}
|
||||
},
|
||||
"remoteUser": "root"
|
||||
}
|
||||
Reference in New Issue
Block a user