Files
bl/.ide/Dockerfile
xinian e74c064945
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
编辑文件 Dockerfile
2026-03-28 15:57:52 +08:00

63 lines
3.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 此文件为远程开发环境配置文件
FROM debian:bookworm
ENV GO_VERSION=1.25.0
ENV GOPATH=/root/go
ENV PATH=/usr/local/go/bin:${GOPATH}/bin:${PATH}
ENV LC_ALL=zh_CN.UTF-8
ENV LANG=zh_CN.UTF-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 && \
rm -rf /var/lib/apt/lists/*
# 安装 Golang
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 && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.54.2 && \
rm -rf go${GO_VERSION}.linux-amd64.tar.gz
# 安装 code-server
RUN curl -fsSL https://code-server.dev/install.sh | sh
# 安装Go工具链
RUN go install -v golang.org/x/tools/gopls@latest && \
go install -v github.com/cweill/gotests/gotests@latest && \
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
# 修复直接执行你提供的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
# 正确安装 code-server 插件修复版
RUN mkdir -p /root/.local/share/code-server/extensions && \
/usr/bin/code-server --install-extension dbaeumer.vscode-eslint --user-data-dir /root/.local/share/code-server && \
/usr/bin/code-server --install-extension pinage404.git-extension-pack --user-data-dir /root/.local/share/code-server && \
/usr/bin/code-server --install-extension redhat.vscode-yaml --user-data-dir /root/.local/share/code-server && \
/usr/bin/code-server --install-extension esbenp.prettier-vscode --user-data-dir /root/.local/share/code-server && \
/usr/bin/code-server --install-extension golang.go --user-data-dir /root/.local/share/code-server && \
/usr/bin/code-server --install-extension eamodio.gitlens --user-data-dir /root/.local/share/code-server && \
/usr/bin/code-server --install-extension waderyan.gitblame --user-data-dir /root/.local/share/code-server && \
/usr/bin/code-server --install-extension donjayamanne.githistory --user-data-dir /root/.local/share/code-server && \
/usr/bin/code-server --install-extension mhutchie.git-graph --user-data-dir /root/.local/share/code-server && \
/usr/bin/code-server --install-extension ms-azuretools.vscode-docker --user-data-dir /root/.local/share/code-server && \
chown -R root:root /root/.local/share/code-server && \
echo "所有插件安装完成 ✅"
# 最后再清理必须放在插件安装之后
RUN apt clean && rm -rf /var/lib/apt/lists/*