適切なアップグレード後にdockerを起動できません(コミュニティバージョン)

適切なアップグレード後にdockerを起動できません(コミュニティバージョン)

docker-cepygrubを使用してXENの仮想マシン内でDebian 10を更新しました。

アップグレード後にDebian 11にアップグレードしましたが、エラーは引き続き発生します。

現在、docker-ceバージョン5:23.0.0-1〜debian.11〜bullseyeを使用しており、デーモンを再起動しようとすると、次のエラーメッセージが表示されます。

Starting Docker Application Container Engine...
level=warning msg="failed to rename /var/lib/docker/tmp for background deletion: rename /var/lib/docker/tmp /var/lib/docker/tmp-old: file exists. Del
eting synchronously" [Channel #1] Channel created" module=grpc                                                                                     
[Channel #1] original dial target is: \"unix:///run/containerd/containerd.sock\"" module=grpc                                 
[Channel #1] parsed dial target is: {Scheme:unix Authority: Endpoint:run/containerd/containerd.sock URL:{Scheme:unix Opaque: U
ser: Host: Path:/run/containerd/containerd.sock RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}" module=grpc [Channel #1] Channel authority set to \"localhost\"" module=grpc                                                              
[Channel #1] Resolver state updated: {\n  \"Addresses\": [\n    {\n      \"Addr\": \"/run/containerd/containerd.sock\",\n \"ServerName\": \"\",\n      \"Attributes\": {},\n      \"BalancerAttributes\": null,\n      \"Type\": 0,\n      \"Metadata\": null\n    }\n  ],\n  \"ServiceConfig\": null,\n  \"Attributes\": null\n} (resolver returned new addresses)" module=grpc [Channel #1] Channel switches to new LB policy \"pick_first\"" module=grpc
[Channel #1 SubChannel #2] Subchannel created" module=grpc                                                           [8/13043]
[Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING" module=grpc                                          
[Channel #1 SubChannel #2] Subchannel picks a new address \"/run/containerd/containerd.sock\" to connect" module=grpc         
[Channel #1] Channel Connectivity change to CONNECTING" module=grpc                                                           
[Channel #1 SubChannel #2] Subchannel Connectivity change to READY" module=grpc                                               
[Channel #1] Channel Connectivity change to READY" module=grpc                                                                
[Channel #4] Channel created" module=grpc                                                                                     
[Channel #4] original dial target is: \"unix:///run/containerd/containerd.sock\"" module=grpc                                 
[Channel #4] parsed dial target is: {Scheme:unix Authority: Endpoint:run/containerd/containerd.sock URL:{Scheme:unix Opaque: $
ser: Host: Path:/run/containerd/containerd.sock RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}" module=grpc                                                                                            
[Channel #4] Channel authority set to \"localhost\"" module=grpc
[Channel #4] Resolver state updated: {\n  \"Addresses\": [\n    {\n      \"Addr\": \"/run/containerd/containerd.sock\",\n
 \"ServerName\": \"\",\n      \"Attributes\": {},\n      \"BalancerAttributes\": null,\n      \"Type\": 0,\n      \"Metadata\": null\n    }\n  ],\n  \"ServiceConfig\": null,\n  \"Attributes\": null\n} (resolver returned new addr$
sses)" module=grpc
[Channel #4] Channel switches to new LB policy \"pick_first\"" module=grpc
[Channel #4 SubChannel #5] Subchannel created" module=grpc
[Channel #4 SubChannel #5] Subchannel Connectivity change to CONNECTING" module=grpc
[Channel #4 SubChannel #5] Subchannel picks a new address \"/run/containerd/containerd.sock\" to connect" module=grpc
[Channel #4] Channel Connectivity change to CONNECTING" module=grpc
[Channel #4 SubChannel #5] Subchannel Connectivity change to READY" module=grpc
[Channel #4] Channel Connectivity change to READY" module=grpc
level=warning msg="Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man docked` to refer to dm.thinpooldev section." storage-driver=devicemapper
level=warning msg="Base device already exists and has filesystem ext4 on it. User specified filesystem  will be ignored." storage-driver=devicemapper
level=error msg="[graphdriver] prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explicitly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/ for more information"
[Channel #1] Channel Connectivity change to SHUTDOWN" module=grpc
[Channel #1 SubChannel #2] Subchannel Connectivity change to SHUTDOWN" module=grpc
[Channel #1 SubChannel #2] Subchannel deleted" module=grpc
[Channel #1] Channel deleted" module=grpc
failed to start daemon: error initializing graphdriver: prior storage driver devicemapper is deprecated and will be removed in a future release; update the the daemon configuration and explic$
tly choose this storage driver to continue using it; visit https://docs.docker.com/go/storage-driver/ for more information

ここで主なエラーメッセージは何ですか?私は推測する:

ストレージドライバ devicemapper は廃止されました。

次のように追加するために編集しようとしました/lib/systemd/system/docker.service --storage-opt dm.thinpooldev

ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --storage-opt dm.thinpooldev

それから私は電話しましたが、systemctl daemon-reload役に立ちませんでした。--storage-opt dm.thinpooldevDocker Community Edition(CE)バージョン5:23.0.0-1はこのオプションをサポートしていないようです。

ベストアンサー1

ストレージドライバはdevicemapper最後のアップデートで廃止され、無効になりました。ストレージドライバをoverlay2

ファイルを開き/etc/docker/daemon.json(またはファイルがない場合は作成)、次のJSON文字列を追加します。

{
  "storage-driver": "overlay2"
}

その後、ドッカーを再起動します。

systemctl restart docker

注目!既存のコンテナはストレージドライバの変更を保持できないため、docker-compose新しいドライバでコンテナを再構築するすべてのファイルを再実行する必要があります。

おすすめ記事