docker-compose up -d
Creating network "toyosu_default" with the default driver
Pulling db (postgis-pgrouting:latest)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.
Continue with the new image? [yN]y
Pulling db (postgis-pgrouting:latest)...
ERROR: pull access denied for postgis-pgrouting, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
ubuntu@ip-172-26-13-137:~/toyosu$
postgres=# \c ca_sim You are now connected to database "ca_sim" as user "postgres". ca_sim=# \dt List of relations Schema | Name | Type | Owner --------+-------------------+-------+---------- public | configuration | table | postgres public | pointsofinterest | table | postgres public | spatial_ref_sys | table | postgres public | ways | table | postgres public | ways_vertices_pgr | table | postgres (5 rows)
ebata@DESKTOP-P6KREM0 MINGW64 ~/xxxxxxx_ride_hailing_go $ docker push ebata_db_data_1_back2 The push refers to repository [docker.io/library/ebata_db_data_1_back2] d103f95b4a98: Preparing 195be5f8be1d: Preparing denied: requested access to the resource is denied
ebata@DESKTOP-P6KREM0 MINGW64 ~/xxxxxxx_ride_hailing_go $ docker push ebata_db_data_1_back2 The push refers to repository [docker.io/library/ebata_db_data_1_back2] d103f95b4a98: Preparing 195be5f8be1d: Preparing denied: requested access to the resource is denied
Reverse Provides: Reading package lists… Building dependency tree… Reading state information… E: Version '2.5.2+dfsg-1~exp1.pgdg90+1' for 'postgresql-11-postgis-2.5' was not found E: Version '2.5.2+dfsg-1~exp1.pgdg90+1' for 'postgresql-11-postgis-2.5-scripts' was not found E: Version '2.5.2+dfsg-1~exp1.pgdg90+1' for 'postgis' was not found Service 'db' failed to build: The command '/bin/sh -c apt-get update && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR && apt-get install -y --no-install-recommends postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION postgis=$POSTGIS_VERSION postgresql-$PG_MAJOR-pgrouting && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
xxxxxxx_ride_hailing_go_app_1 ./main Exit 1 xxxxxxx_ride_hailing_go_data_1 sh Exit 0 xxxxxxx_ride_hailing_go_db_1 docker-entrypoint.sh postgres Exit 1 xxxxxxx_ride_hailing_go_nginx_1 nginx -g daemon off; Up 0.0.0.0:80->80/tcp xxxxxxx_ride_hailing_go_tile38_1 tile38-server -d /data Up 0.0.0.0:19851->9851/tcp xxxxxxx_ride_hailing_go_tile38_data_1 sh Exit 0
となって、DBがどうしても動いてくれない問題発生。手動で起動を試みてみたら、こうなった。
C:\Users\ebata\xxxxxxx_ride_hailing_go>docker start -a xxxxxxx_ride_hailing_go_db_1 Error: Database is uninitialized and superuser password is not specified. You must specify POSTGRES_PASSWORD to a non-empty value for the superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all connections without a password. This is not recommended.
See PostgreSQL documentation about "trust": https://www.postgresql.org/docs/current/auth-trust.html
docker-compose run app go run cmd/dummy_data_generator_concurrent_small/main.go
ああ、疲れた。(これで、ようやく眠れる)
==========
$ cd /path/to/hitachi_ride_hailing_go
$ docker-compose build
# 上記部分が完了するまで、はじめての場合はネットワーク環境により数分かかります
$ docker-compose up -d
$ docker-compose run db createdb -h db -U postgres gis
$ docker-compose run db psql -h db -U postgres -d gis -c 'CREATE EXTENSION pgrouting CASCADE; CREATE EXTENSION hstore;'
$ docker-compose run db psql -h db -U postgres gis < repository/postgresql/data/dump.sql
$ docker-compose run db psql -h db -U postgres -d gis -f repository/postgresql/data/postgis-vt-util.sql
$ docker-compose stop
$ docker-compose start
$ docker-compose run app migrate -database 'postgres://postgres:@db:5432/gis?sslmode=disable' -path ./repository/postgresql/migrations up
$ docker-compose run app go run cmd/dummy_data_generator_concurrent_small/main.go
$ docker-compose stop
$ docker-compose start