0
0

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 3 years have passed since last update.

docker起動時のエラー対処

Last updated at Posted at 2021-08-18

##概要
docker起動時にエラーが発生したので対処方法を記載

##エラー内容

$ docker-compose up
ERROR: Named volume "postgres-data:/var/lib/postgresql/data:rw" is used in service "db" but no declaration was found in the volumes section.

##原因
docker-compose.ymlの記載ミスが原因だった。
volumesの設定で「./」を付け忘れていた。

###修正前

docker-compose.yml
volumes:
- postgres-data:/var/lib/postgresql/data

###修正後

Dockerfile
volumes:
- ./postgres-data:/var/lib/postgresql/data

##参考
https://obel.hatenablog.jp/entry/20191014/1571058968

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?