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

This commit is contained in:
xinian
2026-03-28 13:39:42 +08:00
committed by cnb
parent 6af81c90ca
commit ab7ebc88ba

View File

@@ -2,32 +2,21 @@
FROM debian:bookworm FROM debian:bookworm
ENV GO_VERSION=1.25.0 ENV GO_VERSION=1.25.0
ENV GOPATH=/root/go
ENV PATH=${PATH}:${GOPATH}/bin
ENV LC_ALL=zh_CN.UTF-8
ENV LANG=zh_CN.UTF-8
ENV LANGUAGE=zh_CN.UTF-8
# 安装系统依赖一次性安装无冗余
RUN apt update &&\ RUN apt update &&\
apt install -y --no-install-recommends \ apt install -y wget rsync unzip openssh-server vim lsof git git-lfs locales locales-all libgit2-1.5 libgit2-dev net-tools jq curl &&\
wget rsync unzip openssh-server vim lsof git git-lfs \
locales libgit2-1.5 libgit2-dev net-tools jq curl \
ca-certificates gnupg && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# 安装 Golang # install golang
RUN curl -fsSLO https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz &&\ RUN curl -fsSLO https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz &&\
rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz &&\ rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz &&\
ln -sf /usr/local/go/bin/go /usr/bin/go &&\ ln -sf /usr/local/go/bin/go /usr/bin/go &&\
ln -sf /usr/local/go/bin/gofmt /usr/bin/gofmt &&\ ln -sf /usr/local/go/bin/gofmt /usr/bin/gofmt &&\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.54.2 && \ curl -sSfL https://raw.github.com/golangci/golangci-lint/master/install.sh | sh -s v1.54.2 &&\
rm -rf go${GO_VERSION}.linux-amd64.tar.gz rm -rf go${GO_VERSION}.linux-amd64.tar.gz
# 安装 code-server # install code-server
RUN curl -fsSL https://code-server.dev/install.sh | sh RUN curl -fsSL https://code-server.dev/install.sh | sh
# 安装 code-server 插件
RUN code-server --install-extension dbaeumer.vscode-eslint &&\ RUN code-server --install-extension dbaeumer.vscode-eslint &&\
code-server --install-extension pinage404.git-extension-pack &&\ code-server --install-extension pinage404.git-extension-pack &&\
code-server --install-extension redhat.vscode-yaml &&\ code-server --install-extension redhat.vscode-yaml &&\
@@ -38,49 +27,22 @@ RUN code-server --install-extension dbaeumer.vscode-eslint && \
code-server --install-extension donjayamanne.githistory &&\ code-server --install-extension donjayamanne.githistory &&\
code-server --install-extension mhutchie.git-graph &&\ code-server --install-extension mhutchie.git-graph &&\
code-server --install-extension ms-azuretools.vscode-docker &&\ code-server --install-extension ms-azuretools.vscode-docker &&\
code-server --install-extension PKief.material-icon-theme code-server --install-extension PKief.material-icon-theme &&\
code-server --install-extension tencent-cloud.coding-copilot &&\
echo done
# 安装 Go 工具链 # install Go Tools
RUN go install -v golang.org/x/tools/gopls@latest && \ ENV GOPATH /root/go
go install -v github.com/cweill/gotests/gotests@latest && \ ENV PATH="${PATH}:${GOPATH}/bin"
go install -v github.com/josharian/impl@latest && \
go install -v github.com/haya14busa/goplay/cmd/goplay@latest && \
go install -v github.com/go-delve/delve/cmd/dlv@latest && \
go install github.com/goreleaser/goreleaser/v2@latest
# 安装 Node.js 22修复旧版node无法安装codex的问题 RUN go install -v golang.org/x/tools/gopls@latest
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg && \ RUN go install -v github.com/cweill/gotests/gotests@latest
echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ RUN go install -v github.com/josharian/impl@latest
apt update && \ RUN go install -v github.com/haya14busa/goplay/cmd/goplay@latest
apt install -y nodejs && \ RUN go install -v github.com/go-delve/delve/cmd/dlv@latest
npm config set registry https://registry.npmmirror.com/ && \ # install goreleaser
npm install -g @openai/codex && \ RUN go install github.com/goreleaser/goreleaser/v2@latest
rm -rf /var/lib/apt/lists/*
# 配置 Codex ENV LC_ALL zh_CN.UTF-8
RUN mkdir -p /root/.codex ENV LANG zh_CN.UTF-8
ENV LANGUAGE zh_CN.UTF-8
# 写入 config.toml
RUN 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
# 写入 auth.json
RUN cat > /root/.codex/auth.json <<'EOF'
{
"auth_mode": "apikey",
"OPENAI_API_KEY": "sk-E0ZZIFNnD0RkhMC9pT2AGMutz9vNy2VLNrgyyobT5voa81pQ"
}
EOF
# 权限配置
RUN chmod 600 /root/.codex/auth.json