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

修改GCP虚拟机实例规格后Docker异常的问题求助

Docker Layer Corruption After Resizing GCP VM Instance

I've hit an intermittent, tricky Docker issue that pops up after adjusting the machine type of a Google Compute Platform (GCP) VM instance. The symptoms are inconsistent but always disruptive: previously stable images fail to run, can't be deleted, or throw vague errors—think missing Linux keys, duplicate or missing layers, and more. And the worst part? It doesn't happen every time.

Recent Reproducible Case

Just now, an image that had run flawlessly hundreds of times in the same environment broke right before a reboot. Here's the exact sequence of commands and errors:

$ docker run --rm -it mbloore/model:conda4.3.1-aq0.1.9
docker: Error response from daemon: layer does not exist.

$ docker pull mbloore/model:conda4.3.1-aq0.1.9
conda4.3.1-aq0.1.9: Pulling from mbloore/model
Digest: sha256:4d203b18fd57f9d867086cc0c97476750b42a86f32d8a9f55976afa59e699b28
Status: Image is up to date for mbloore/model:conda4.3.1-aq0.1.9

$ docker rmi mbloore/model:conda4.3.1-aq0.1.9
Error response from daemon: unrecognized image ID sha256:8315bb7add4fea22d760097bc377dbc6d9f5572bd71e98911e8080924724554e

$ docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE

Key Observations

  • docker images returns an empty list, but the Docker data directory still has tons of files
  • Some layer hashes are still recognized, which suggests corrupted metadata/indexes rather than actual missing layer data

Temporary Fixes That Worked

So far, only two methods have reliably resolved the issue:

  1. Reboot the VM instance: Docker starts working normally immediately after a reboot, no extra steps needed
  2. Manual Docker directory cleanup:
    • Delete large Docker data directories (e.g., /var/lib/docker/image, /var/lib/docker/overlay2)
    • Recreate empty directories with the correct permissions
    • Reboot the VM, then pull the required images again

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.21 03:55:01