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

VSCode远程容器插件执行docker run报错 macOS构建镜像Manjaro运行失败

修复步骤

1. 修正devcontainer.json语法错误

当前配置存在多处不符合JSON标准的尾逗号,会导致插件解析配置失败,删除所有末尾元素后的多余逗号即可,修正后的完整配置参考:

{
  "name": "MLSC",
  "image": "ezraeisbrenner/misu-course-modelling-large-scale-circulation:2021.1",
  "settings": {
    "editor.formatOnSave": true,
    "python.pythonPath": "/usr/local/bin/python",
    "python.languageServer": "Pylance",
    "python.formatting.provider": "black",
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": true,
    "python.formatting.blackPath": "/usr/local/py-utils/bin/black",
    "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
    "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
    "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
    "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
    "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
    "files.associations": {
      "namelist": "FortranFreeForm"
    },
    "[FortranFreeForm]": {
      "editor.defaultFormatter": "Blamsoft.fprettify"
    }
  },
  "extensions": [
    "ms-python.python",
    "ms-python.vscode-pylance",
    "editorconfig.editorconfig",
    "krvajalm.linter-gfortran",
    "blamsoft.fprettify"
  ],
  "remoteUser": "vscode",
  "updateRemoteUserUID": true
}

新增的updateRemoteUserUID参数会自动将容器内vscode用户的UID/GID同步为宿主机当前用户的ID,解决macOS与Linux用户ID不匹配导致的权限问题。

2. 适配cgroup版本兼容问题

Manjaro作为Arch系发行版默认启用cgroup v2,你使用的2021年的旧镜像仅支持cgroup v1,需要切换到cgroup v1验证:

  • 编辑/etc/default/grub文件,在GRUB_CMDLINE_LINUX_DEFAULT参数末尾追加systemd.unified_cgroup_hierarchy=0
  • 执行sudo update-grub更新引导配置
  • 重启系统后再尝试启动Remote Container

3. 验证Docker权限配置

执行以下命令将当前用户加入docker用户组,避免权限不足导致的执行失败:

sudo usermod -aG docker $USER

执行完成后注销当前用户重新登录即可生效。

4. 校验镜像完整性

如果以上操作都完成后仍报错,删除本地镜像重新拉取,避免镜像文件损坏导致的启动失败:

docker rmi ezraeisbrenner/misu-course-modelling-large-scale-circulation:2021.1

重新启动Remote Container时会自动拉取对应镜像文件。

内容的提问来源于stack exchange,提问作者E.Eisbrenner

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.02 08:48:02