podmanでerror creating container storageになってコンテナを起動できない
podmanでコンテナが存在しないのに、以下のエラーメッセージが出てコンテナを起動できない時があります。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: error creating container storage: the container name "mycontainer" is already in use by "d8d1e480fbe84a57a888d9db9b2de3c9d8d1e480fbe84a57a888d9db9b2de3c9". You have to remove that container to be able to reuse that name.: that name is already in use |
podman ps -a を実行してもエラーになったIDのコンテナは存在しないし、podman rm ID で削除しようとしてもエラーになります。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ podman --version | |
podman version 1.4.4 | |
$ podman ps -a | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
$ podman rm d8d1 | |
Error: no container with name or ID d8d1 | |
$ |
メッセージにはYou have to remove that container to be able to reuse that name.(その名前を再利用するには、そのコンテナを削除する必要があります)とありますが、単純に podman rm ID でコンテナを削除するのではなく、--storage オプションを指定して以下のように削除します。IDには実際のメッセージに表示されているIDを指定します。例えば、上の例であれば、podman rm --storage d8d1 になります。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
podman rm --storage ID |