You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSCode Devcontainer大文件上传失败问题排查求助

问题:Devcontainer环境下PHP大文件上传出现错误3(部分上传)

我在笔记本电脑上通过VSCode搭建了基于Devcontainer的开发环境,所有项目代码克隆至Devcontainer的命名卷中,环境配置了Docker-in-Docker以适配不同项目需求。

其中一个支持用户通过网页上传大型ZIP文件进行处理的项目,在上传过程中出现异常:文件上传不完整,请求体未传递,PHP返回文件错误3(部分上传)。但将代码克隆到Devcontainer外部运行时,一切功能正常,目前无法定位问题瓶颈。

Dockerfile配置

ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

ARG USERNAME=vscode

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
    && apt-get -y install --no-install-recommends openssh-client gcc make software-properties-common ca-certificates lsb-release apt-transport-https zip 
RUN add-apt-repository ppa:ondrej/php
RUN apt update && apt install -y --no-install-recommends php8.1 php8.1-curl php8.1-mbstring php8.1-xml php-codesniffer

COPY --from=composer:2.2.17 /usr/bin/composer /usr/bin/composer
RUN update-alternatives --set php /usr/bin/php8.1

devcontainer.json配置

{
  "name": "Ubuntu",
  "build": {
    "dockerfile": "Dockerfile",
    "args": {
      "VARIANT": "ubuntu-22.04"
    }
  },
  "features": {
    "ghcr.io/devcontainers/features/common-utils:2": {
      "configureZshAsDefaultShell": true,
      "nonFreePackages": true,
      "username": "vscode"
    },
    "ghcr.io/devcontainers/features/git:1": {},
    "ghcr.io/devcontainers/features/git-lfs:1": {},
    "ghcr.io/devcontainers/features/docker-in-docker:2": {
      "dockerDashComposeVersion": "v2"
    }
  },
  "remoteUser": "vscode",
  "workspaceMount": "source=devcontainer-volume,target=/workspace,type=volume",
  "workspaceFolder": "/workspace"
}

内容的提问来源于stack exchange,提问作者Nicolo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 23:12:08