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 for WindowsでLaradockのpostgresの起動に失敗する時の振り返りシート

Last updated at Posted at 2020-07-09

はじめに

$ docker-compose up -d postgress
Starting laravel-sns_postgres_1         ... done 

と一見__doneしてるから大丈夫に見えるが...。__

$ docker-compose ps
             Name                           Command                State     Ports
----------------------------------------------------------------------------------
laravel-sns_postgres_1           docker-entrypoint.sh postgres    Exit 1

即終了してる...。というときの備忘録。
1つずつためして、再起動をかけて確認すること。

対策

各db.shの改行コードを変更

laradock/postgres/docker-entrypoint-initdb.d内の各*.shファイルの改行コードを__CRLF__から__LF__へ変更し保存。

該当ファイルは以下

  • init_sonarqube_db.sh
  • init_confluence_db.sh
  • init_gitlab_db.sh
  • init_jupyterhub_db.sh

docker-compose.ymlのvolumesを変更

docker-compose.yml
    postgres:
      build: ./postgres
      volumes:
        # - ${DATA_PATH_HOST}/postgres:/var/lib/postgresql/data
        - ${DATA_PATH_HOST}/postgres:/var/lib/postgresql/

.envのDATA_PATH_HOSTを変更

.env
# DATA_PATH_HOST=~/.laradock/data
DATA_PATH_HOST=../data
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?