With the command docker-compose up dbinit I get the following

docker-compose up dbinitStarting example_mysql_1 ... done Starting example_dbinit_1 ... done Attaching to example_dbinit_1 dbinit_1 | wait-for-it.sh: waiting for mysql:3306 without a timeout dbinit_1 | wait-for-it.sh: mysql:3306 is available after 0 seconds dbinit_1 | Did you mean to run dotnet SDK commands? Please install dotnet SDK from: dbinit_1 | https://go.microsoft.com/fwlink/? LinkID=798306&clcid=0x409 example_dbinit_1 exited with code 145 

What is the reason for this completion? docker-compose file:

 services: mysql: image: "mysql:8.0.0" volumes: - productdata:/var/lib/mysql networks: - backend environment: - MYSQL_ROOT_PASSWORD=mysecret - bind-address=0.0.0.0 dbinit: build: context: . dockerfile: Dockerfile networks: - backend environment: - INITDB=true - DBHOST=mysql depends_on: - mysql mvc: build: context: . dockerfile: Dockerfile networks: - backend - frontend environment: - DBHOST=mysql depends_on: - mysql loadbalancer: image: dockercloud/haproxy:1.2.1 ports: - 3000:80 links: - mvc volumes: - /var/run/docker.sock:/var/run/docker.sock networks: - frontend 

Dockerfile:

 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base COPY dist /app COPY node_modules/wait-for-it.sh/bin/wait-for-it /app/wait-for-it.sh RUN chmod +x /app/wait-for-it.sh WORKDIR /app EXPOSE 80/tcp ENV WAITHOST=mysql WAITPORT=3306 ENTRYPOINT ./wait-for-it.sh $WAITHOST:$WAITPORT --timeout=0 \ && exec dotnet ExampleApp.dll 
  • This is the downloaded npm package - Sergey Chizhik
  • exec dotnet ExampleApp.dll you copied from the example? does he exist there? - Senior Pomidor
  • for sure, there should be example.dll - Sergey Chizhik
  • but did not solve the problem - Sergey Chizhik
  • Is the error the same after deletion or what? - Senior Pomidor

0