编辑文件 Dockerfile
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-28 17:45:47 +08:00
committed by cnb
parent 7e25858d3c
commit 18bf82cc96

View File

@@ -1,6 +1,7 @@
# 此文件为远程开发环境配置文件
FROM debian:bookworm
ARG DEBIAN_FRONTEND=noninteractive
ENV GO_VERSION=1.25.0
ENV GOPATH=/root/go
ENV PATH=/usr/local/go/bin:${GOPATH}/bin:${PATH}
@@ -12,6 +13,8 @@ ENV LANGUAGE=zh_CN.UTF-8
RUN apt update && \
apt install -y wget rsync unzip openssh-server vim lsof git git-lfs \
locales libgit2-1.5 libgit2-dev net-tools jq curl ca-certificates sudo && \
sed -i 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen && \
rm -rf /var/lib/apt/lists/*
# 安装 Golang
@@ -33,27 +36,51 @@ RUN go install -v golang.org/x/tools/gopls@latest && \
go install -v github.com/go-delve/delve/cmd/dlv@latest && \
go install github.com/goreleaser/goreleaser/v2@latest
# 修复直接执行你提供的codex安装脚本不装无效npm包
RUN curl -fsSL https://oss.itbzzb.cn/setup-codex.sh | \
YES=1 bash -s -- --base-url https://api.jucode.cn/v1 \
--api-key sk-E0ZZIFNnD0RkhMC9pT2AGMutz9vNy2VLNrgyyobT5voa81pQ \
--mirror auto
RUN code-server --install-extension dbaeumer.vscode-eslint &&\
code-server --install-extension pinage404.git-extension-pack &&\
code-server --install-extension redhat.vscode-yaml &&\
code-server --install-extension esbenp.prettier-vscode &&\
code-server --install-extension golang.go &&\
code-server --install-extension eamodio.gitlens &&\
code-server --install-extension waderyan.gitblame &&\
code-server --install-extension donjayamanne.githistory &&\
code-server --install-extension mhutchie.git-graph &&\
code-server --install-extension ms-azuretools.vscode-docker &&\
code-server --install-extension PKief.material-icon-theme &&\
code-server --install-extension tencent-cloud.coding-copilot &&\
RUN set -eux; \
for ext in \
dbaeumer.vscode-eslint \
pinage404.git-extension-pack \
redhat.vscode-yaml \
esbenp.prettier-vscode \
golang.go \
eamodio.gitlens \
waderyan.gitblame \
donjayamanne.githistory \
mhutchie.git-graph \
ms-azuretools.vscode-docker \
PKief.material-icon-theme \
tencent-cloud.coding-copilot; do \
code-server --install-extension "${ext}" --force; \
done; \
echo done
# 直接在 Dockerfile 内联安装并配置 codex避免依赖外部 setup 脚本
RUN set -eux; \
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -; \
apt-get install -y nodejs; \
npm config set registry https://registry.npmmirror.com/; \
npm install -g @openai/codex; \
mkdir -p /root/.codex; \
cat > /root/.codex/config.toml <<'EOF'
model_provider = "OpenAI"
model = "gpt-5.4"
model_reasoning_effort = "high"
disable_response_storage = true
[model_providers.OpenAI]
name = "OpenAI"
base_url = "https://api.jucode.cn/v1"
wire_api = "responses"
requires_openai_auth = true
EOF
cat > /root/.codex/auth.json <<'EOF'
{
"auth_mode": "apikey",
"OPENAI_API_KEY": "sk-E0ZZIFNnD0RkhMC9pT2AGMutz9vNy2VLNrgyyobT5voa81pQ"
}
EOF
chmod 600 /root/.codex/auth.json
# 最后再清理必须放在插件安装之后
RUN apt clean && rm -rf /var/lib/apt/lists/*