# WorkPod - 全栈开发环境容器 (本地包构建版) # 包含:Ubuntu + Python + Go + Rust + Node + MySQL + Redis + Claude Code 2.1.79 + OpenClaw FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Asia/Shanghai # ============ 配置阿里云镜像源 ============ RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \ sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list # ============ 基础工具 (合并安装减少层数) ============ RUN apt-get update && apt-get install -y --no-install-recommends \ # 基础工具 curl wget git vim nano less tree jq \ # 系统工具 procps htop net-tools iputils-ping lsof \ # 压缩工具 zip unzip xz-utils \ # 构建工具 build-essential pkg-config \ # SSL/加密 ca-certificates gnupg \ # SSH + PTY 支持 openssh-server locales \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* \ && mkdir -p /var/run/sshd \ && echo 'root:workpod123' | chpasswd \ && sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config # 中文和 UTF-8 支持 RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen ENV LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 # ============ Python ============ RUN apt-get update && apt-get install -y --no-install-recommends \ python3 python3-pip python3-venv \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* \ && ln -sf /usr/bin/python3 /usr/bin/python # ============ 复制本地包到镜像 ============ COPY packages/ /tmp/packages/ # ============ Node.js v24.14.0 (Krypton LTS) ============ RUN cd /tmp/packages \ && tar -xf node-v24.14.0-linux-x64.tar.xz -C /usr/local --strip-components=1 \ && npm install -g npm@latest pnpm yarn \ && npm cache clean --force # ============ Go 1.26.1 (最新版) ============ ENV GOPATH=/root/go ENV PATH=/usr/local/go/bin:$GOPATH/bin:$PATH RUN cd /tmp/packages \ && tar -xzf go1.26.1.linux-amd64.tar.gz -C /usr/local # ============ Rust 1.94.0 ============ ENV CARGO_HOME=/root/.cargo RUSTUP_HOME=/root/.rustup ENV PATH=$CARGO_HOME/bin:$PATH RUN mkdir -p /opt/rust $CARGO_HOME/bin \ && cd /tmp/packages \ && tar -xf rust-1.94.0-x86_64-unknown-linux-gnu.tar.xz -C /opt/rust \ && ln -sf /opt/rust/rust-1.94.0-x86_64-unknown-linux-gnu/bin/* $CARGO_HOME/bin/ # ============ Claude Code + OpenClaw (离线安装) ============ RUN cd /tmp/packages \ && npm install -g claude-code-2.1.79.tgz \ && npm install -g openclaw-2026.3.13.tgz \ && npm cache clean --force # ============ MySQL 8.0 (手动启动) ============ RUN apt-get update && apt-get install -y --no-install-recommends \ mysql-server \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* \ && mkdir -p /var/run/mysqld \ && chown mysql:mysql /var/run/mysqld # ============ Redis (手动启动) ============ RUN apt-get update && apt-get install -y --no-install-recommends \ redis-server \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* # ============ 更多常用工具 ============ RUN apt-get update && apt-get install -y --no-install-recommends \ # 网络工具 netcat-openbsd \ # 文本处理 ripgrep fd-find \ # 进程管理 tmux \ # 其他 bash-completion \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* # ============ 清理临时包 ============ RUN rm -rf /tmp/packages # ============ 工作目录 ============ WORKDIR /workspace # ============ 启动脚本 ============ COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh EXPOSE 22 80 443 3306 6379 ENTRYPOINT ["/entrypoint.sh"]