Not able to run code with the Docker-Compose method

Author: pol-todoCreated Dec 30, 2021Updated May 22, 2024

Hi all,

Update: it's working fine on a mac. The problem seems to be on Window's machines.

I've cloned the repo and followed the instructions in the README.md for the Docker method using docker-compose up (I've tried on windows 10, via powershell 5, and through Window's WSL2 via ubuntu 18.04) to start this application. The Docker method's web_1 service dies early (please see output below).

Perhaps there is a git clone param I'm missing? (There's a suspcious error below | /start.sh: set: line 1: illegal option - ), and google seems to indicate it's a line-ending issue.

Here's the docker-compose output:

[+] Running 10/10
 - Network wild-workouts-go-ddd-example_default                        Created                                                                                              0.8s
 - Container wild-workouts-go-ddd-example_mysql_1                      Created                                                                                              4.1s
 - Container wild-workouts-go-ddd-example_web_1                        Created                                                                                              0.2s
 - Container wild-workouts-go-ddd-example_firestore_1                  Created                                                                                              4.1s
 - Container wild-workouts-go-ddd-example_firestore-component-tests_1  Created                                                                                              5.2s
 - Container wild-workouts-go-ddd-example_users-http_1                 Created                                                                                              2.0s
 - Container wild-workouts-go-ddd-example_trainer-http_1               Created                                                                                              1.2s
 - Container wild-workouts-go-ddd-example_trainings-http_1             Created                                                                                              3.1s
 - Container wild-workouts-go-ddd-example_trainer-grpc_1               Created                                                                                              1.2s
 - Container wild-workouts-go-ddd-example_users-grpc_1                 Created                                                                                              1.2s
Attaching to firestore-component-tests_1, firestore_1, mysql_1, trainer-grpc_1, trainer-http_1, trainings-http_1, users-grpc_1, users-http_1, web_1
web_1                        | /start.sh: set: line 1: illegal option -
mysql_1                      | 2021-12-30 21:55:19+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.27-1debian10 started.
mysql_1                      | 2021-12-30 21:55:19+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
mysql_1                      | 2021-12-30 21:55:19+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.27-1debian10 started.
mysql_1                      | 2021-12-30 21:55:20+00:00 [Note] [Entrypoint]: Initializing database files
mysql_1                      | 2021-12-30T21:55:20.114353Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.27) initializing of server in progress as process 43
mysql_1                      | 2021-12-30T21:55:20.138797Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
web_1 exited with code 2
mysql_1                      | 2021-12-30T21:55:22.041116Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
firestore-component-tests_1  | ⚠  emulators: You are not currently authenticated so some features may not work correctly. Please run firebase login to authenticate the CLI.
firestore-component-tests_1  | i  emulators: Starting emulators: firestore
firestore-component-tests_1  | ⚠  firestore: Did not find a Cloud Firestore rules file specified in a firebase.json config file.
firestore-component-tests_1  | ⚠  firestore: The emulator will default to allowing all reads and writes. Learn more about this option: https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration.
firestore-component-tests_1  | i  firestore: Firestore Emulator logging to firestore-debug.log
firestore_1                  | ⚠  emulators: You are not currently authenticated so some features may not work correctly. Please run firebase login to authenticate the CLI.
firestore_1                  | i  emulators: Starting emulators: firestore
firestore_1                  | ⚠  firestore: Did not find a Cloud Firestore rules file specified in a firebase.json config file.
firestore_1                  | ⚠  firestore: The emulator will default to allowing all reads and writes. Learn more about this option: https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration.
firestore_1                  | i  firestore: Firestore Emulator logging to firestore-debug.log
trainer-grpc_1               | [00] Starting service
trainer-grpc_1               | [00] go: downloading github.com/go-chi/chi/v5 v5.0.5
trainer-grpc_1               | [00] go: downloading google.golang.org/grpc v1.40.0
trainer-grpc_1               | [00] go: downloading github.com/sirupsen/logrus v1.5.0
trainer-grpc_1               | [00] go: downloading github.com/pkg/errors v0.9.1
trainer-grpc_1               | [00] go: downloading github.com/x-cray/logrus-prefixed-formatter v0.5.2
trainings-http_1             | [00] Starting service
trainer-grpc_1               | [00] go: downloading firebase.google.com/go v3.12.0+incompatible
trainer-grpc_1               | [00] go: downloading github.com/go-chi/cors v1.0.1
trainer-grpc_1               | [00] go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
trainer-grpc_1               | [00] go: downloading google.golang.org/api v0.21.0
trainer-grpc_1               | [00] go: downloading github.com/golang/protobuf v1.5.2
trainings-http_1             | [00] go: downloading github.com/go-chi/chi/v5 v5.0.5
trainings-http_1             | [00] go: downloading firebase.google.com/go v3.12.0+incompatible
trainer-http_1               | [00] Starting service
trainings-http_1             | [00] go: downloading github.com/go-chi/cors v1.0.1
trainings-http_1             | [00] go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
users-http_1                 | [00] Starting service
trainings-http_1             | [00] go: downloading github.com/sirupsen/logrus v1.5.0
firestore-component-tests_1  | i  ui: Emulator UI logging to ui-debug.log
trainings-http_1             | [00] go: downloading google.golang.org/api v0.21.0
trainings-http_1             | [00] go: downloading google.golang.org/grpc v1.40.0
trainings-http_1             | [00] go: downloading cloud.google.com/go v0.38.0
users-grpc_1                 | [00] Starting service
trainer-http_1               | [00] go: downloading github.com/go-chi/chi/v5 v5.0.5
trainer-http_1               | [00] go: downloading github.com/pkg/errors v0.9.1
trainer-http_1               | [00] go: downloading google.golang.org/grpc v1.40.0
trainer-http_1               | [00] go: downloading github.com/sirupsen/logrus v1.5.0
trainer-http_1               | [00] go: downloading cloud.google.com/go/firestore v1.2.0
trainings-http_1             | [00] go: downloading github.com/x-cray/logrus-prefixed-formatter v0.5.2
trainer-http_1               | [00] go: downloading firebase.google.com/go v3.12.0+incompatible
firestore-component-tests_1  | 
firestore-component-tests_1  | ┌─────────────────────────────────────────────────────────────────────┐
firestore-component-tests_1  | │ ✔  All emulators ready! View status and logs at http://0.0.0.0:4000 │
firestore-component-tests_1  | └─────────────────────────────────────────────────────────────────────┘
firestore-component-tests_1  |
firestore-component-tests_1  | ┌───────────┬──────────────┬───────────────────────────────┐
firestore-component-tests_1  | │ Emulator  │ Host:Port    │ View in Emulator UI           │
firestore-component-tests_1  | ├───────────┼──────────────┼───────────────────────────────┤
firestore-component-tests_1  | │ Firestore │ 0.0.0.0:8787 │ http://0.0.0.0:4000/firestore │
firestore-component-tests_1  | └───────────┴──────────────┴───────────────────────────────┘
firestore-component-tests_1  |   Other reserved ports: 4400, 4500
firestore-component-tests_1  |
firestore-component-tests_1  | Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files.
firestore-component-tests_1  |
trainings-http_1             | [00] go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
users-http_1                 | [00] go: downloading cloud.google.com/go/firestore v1.2.0
users-http_1                 | [00] go: downloading firebase.google.com/go v3.12.0+incompatible
trainer-http_1               | [00] go: downloading github.com/go-chi/cors v1.0.1
trainer-http_1               | [00] go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
users-http_1                 | [00] go: downloading github.com/go-chi/chi/v5 v5.0.5
users-http_1                 | [00] go: downloading github.com/go-chi/render v1.0.1
users-http_1                 | [00] go: downloading github.com/golang/protobuf v1.5.2
users-http_1                 | [00] go: downloading github.com/pkg/errors v0.9.1
trainer-http_1               | [00] go: downloading google.golang.org/api v0.21.0
users-http_1                 | [00] go: downloading github.com/sirupsen/logrus v1.5.0
trainings-http_1             | [00] go: downloading github.com/deepmap/oapi-codegen v1.9.0
users-http_1                 | [00] go: downloading google.golang.org/api v0.21.0
users-grpc_1                 | [00] go: downloading firebase.google.com/go v3.12.0+incompatible
users-grpc_1                 | [00] go: downloading cloud.google.com/go/firestore v1.2.0
users-grpc_1                 | [00] go: downloading github.com/go-chi/chi/v5 v5.0.5
users-http_1                 | [00] go: downloading google.golang.org/grpc v1.40.0
users-grpc_1                 | [00] go: downloading github.com/go-chi/render v1.0.1
users-grpc_1                 | [00] go: downloading github.com/golang/protobuf v1.5.2
trainings-http_1             | [00] go: downloading github.com/go-chi/render v1.0.1
users-grpc_1                 | [00] go: downloading github.com/pkg/errors v0.9.1
trainer-grpc_1               | [00] go: downloading google.golang.org/protobuf v1.27.1
users-grpc_1                 | [00] go: downloading github.com/sirupsen/logrus v1.5.0
trainings-http_1             | [00] go: downloading github.com/google/uuid v1.1.2
firestore_1                  | i  ui: Emulator UI logging to ui-debug.log
trainer-grpc_1               | [00] go: downloading cloud.google.com/go/firestore v1.2.0
trainer-grpc_1               | [00] go: downloading github.com/deepmap/oapi-codegen v1.9.0
trainer-grpc_1               | [00] go: downloading github.com/go-chi/render v1.0.1
trainer-grpc_1               | [00] go: downloading cloud.google.com/go v0.55.0
users-http_1                 | [00] go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
users-grpc_1                 | [00] go: downloading google.golang.org/api v0.21.0
firestore_1                  | 
firestore_1                  | ┌─────────────────────────────────────────────────────────────────────┐
firestore_1                  | │ ✔  All emulators ready! View status and logs at http://0.0.0.0:4000 │
firestore_1                  | └─────────────────────────────────────────────────────────────────────┘
firestore_1                  |
firestore_1                  | ┌───────────┬──────────────┬───────────────────────────────┐
firestore_1                  | │ Emulator  │ Host:Port    │ View in Emulator UI           │
firestore_1                  | ├───────────┼──────────────┼───────────────────────────────┤
firestore_1                  | │ Firestore │ 0.0.0.0:8787 │ http://0.0.0.0:4000/firestore │
firestore_1                  | └───────────┴──────────────┴───────────────────────────────┘
users-grpc_1                 | [00] go: downloading cloud.google.com/go v0.55.0
firestore_1                  |   Other reserved ports: 4400, 4500
firestore_1                  | 
firestore_1                  | Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files.
firestore_1                  |  
users-grpc_1                 | [00] go: downloading google.golang.org/grpc v1.40.0
users-http_1                 | [00] go: downloading github.com/go-chi/cors v1.0.1
trainings-http_1             | [00] go: downloading golang.org/x/sys v0.0.0-20211031064116-611d5d643895
users-http_1                 | [00] go: downloading cloud.google.com/go v0.55.0
users-grpc_1                 | [00] go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
trainer-http_1               | [00] go: downloading github.com/golang/protobuf v1.5.2
trainings-http_1             | [00] go: downloading github.com/golang/protobuf v1.5.2
trainer-http_1               | [00] go: downloading cloud.google.com/go v0.55.0
users-grpc_1                 | [00] go: downloading github.com/go-chi/cors v1.0.1
trainer-http_1               | [00] go: downloading google.golang.org/protobuf v1.27.1
trainer-http_1               | [00] go: downloading github.com/x-cray/logrus-prefixed-formatter v0.5.2
trainer-http_1               | [00] go: downloading github.com/deepmap/oapi-codegen v1.9.0
trainer-http_1               | [00] go: downloading github.com/go-chi/render v1.0.1
users-http_1                 | [00] go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
trainer-grpc_1               | [00] go: downloading github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
trainer-grpc_1               | [00] go: downloading golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
trainer-grpc_1               | [00] go: downloading golang.org/x/sys v0.0.0-20211031064116-611d5d643895
trainings-http_1             | [00] go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
trainer-grpc_1               | [00] go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
users-grpc_1                 | [00] go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
users-http_1                 | [00] go: downloading google.golang.org/protobuf v1.27.1
users-http_1                 | [00] go: downloading github.com/x-cray/logrus-prefixed-formatter v0.5.2
users-grpc_1                 | [00] go: downloading github.com/x-cray/logrus-prefixed-formatter v0.5.2
trainer-grpc_1               | [00] go: downloading go.uber.org/multierr v1.1.0
trainer-http_1               | [00] go: downloading golang.org/x/sys v0.0.0-20211031064116-611d5d643895
trainer-grpc_1               | [00] go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
trainer-http_1               | [00] go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
users-http_1                 | [00] go: downloading golang.org/x/sys v0.0.0-20211031064116-611d5d643895
users-http_1                 | [00] go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
users-grpc_1                 | [00] go: downloading google.golang.org/protobuf v1.27.1
trainings-http_1             | [00] go: downloading github.com/pkg/errors v0.9.1
trainings-http_1             | [00] go: downloading google.golang.org/protobuf v1.27.1
mysql_1                      | 2021-12-30T21:55:33.948379Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
mysql_1                      | 2021-12-30T21:55:33.948442Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
users-grpc_1                 | [00] go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
users-grpc_1                 | [00] go: downloading golang.org/x/sys v0.0.0-20211031064116-611d5d643895
trainer-grpc_1               | [00] go: downloading golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
mysql_1                      | 2021-12-30T21:55:34.211173Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the 
--initialize-insecure option.
trainer-grpc_1               | [00] go: downloading google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
trainer-grpc_1               | [00] go: downloading github.com/go-sql-driver/mysql v1.4.0
trainings-http_1             | [00] go: downloading golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
trainings-http_1             | [00] go: downloading github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
trainings-http_1             | [00] go: downloading golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
trainer-http_1               | [00] go: downloading github.com/go-sql-driver/mysql v1.4.0
trainer-http_1               | [00] go: downloading github.com/jmoiron/sqlx v1.2.0
trainer-grpc_1               | [00] go: downloading github.com/jmoiron/sqlx v1.2.0
users-grpc_1                 | [00] go: downloading github.com/googleapis/gax-go/v2 v2.0.5
users-grpc_1                 | [00] go: downloading google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
users-http_1                 | [00] go: downloading google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
users-http_1                 | [00] go: downloading golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
trainer-http_1               | [00] go: downloading go.uber.org/multierr v1.1.0
users-http_1                 | [00] go: downloading github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
trainer-http_1               | [00] go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
users-http_1                 | [00] go: downloading golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
trainings-http_1             | [00] go: downloading github.com/googleapis/gax-go/v2 v2.0.5
users-grpc_1                 | [00] go: downloading github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
users-grpc_1                 | [00] go: downloading golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
users-grpc_1                 | [00] go: downloading cloud.google.com/go/storage v1.6.0
trainings-http_1             | [00] go: downloading google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
trainer-grpc_1               | [00] go: downloading github.com/mattn/go-colorable v0.1.8
users-http_1                 | [00] go: downloading cloud.google.com/go/storage v1.6.0
trainer-grpc_1               | [00] go: downloading github.com/googleapis/gax-go/v2 v2.0.5
trainer-http_1               | [00] go: downloading google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
trainer-grpc_1               | [00] go: downloading cloud.google.com/go/storage v1.6.0
trainer-http_1               | [00] go: downloading golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
trainer-http_1               | [00] go: downloading github.com/googleapis/gax-go/v2 v2.0.5
users-http_1                 | [00] go: downloading github.com/googleapis/gax-go/v2 v2.0.5
trainer-grpc_1               | [00] go: downloading golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
trainer-grpc_1               | [00] go: downloading go.uber.org/atomic v1.4.0
trainer-grpc_1               | [00] go: downloading github.com/mattn/go-isatty v0.0.14
users-grpc_1                 | [00] go: downloading golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
trainer-http_1               | [00] go: downloading github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
trainer-http_1               | [00] go: downloading golang.or

Source: ThreeDotsLabs/wild-workouts-go-ddd-example