1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

dockerのmysqlコンテナがrestartingになってしまう

Posted at

解決方法
・起動に失敗した際に作られたvolumeを削除できていなかった

[手順]
1.docker-compose.ymlで指定したvolumeフォルダに移動
2.下記コマンドを実行(Permisson definedになった場合はsudoで)

$ rm -rf *

3.dockerコンテナをstop

$ docker-compose stop

4.dockerコンテナを削除(正常に動かないコンテナを指定)

docker-compose rm -f [コンテナ名]

5.使わないvolumeを削除

docker system pure -a -f --volume

6.dockerを起動

docker-compose up -d --no-recreate --build

7.コンテナのステータスを確認

#statusが「up」となっていたらOK
docker ps 
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?