Guest User

Untitled

a guest
Jul 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. FROM microsoft/aspnetcore-build:2.0 AS build-env
  2. WORKDIR /app
  3.  
  4. # Copy csproj and restore as distinct layers
  5. COPY *.csproj ./
  6. RUN dotnet restore test.csproj
  7.  
  8. # Copy everything else and build
  9. COPY . ./
  10. RUN dotnet publish -c Release -o out test.csproj
  11.  
  12.  
  13.  
  14. # Build runtime image
  15. FROM microsoft/aspnetcore:2.0
  16. WORKDIR /app
  17. COPY ./entrypoint.sh ./app/
  18. RUN chmod +x ./app/entrypoint.sh
  19. CMD /bin/bash ./app/entrypoint.sh
  20.  
  21. COPY --from=build-env /app/out .
  22. ENTRYPOINT ["dotnet", "test.dll"]
  23.  
  24. #!/bin/bash
  25. # wait-for-MySql.sh
  26.  
  27. set -e
  28.  
  29. host="$1"
  30. shift
  31. cmd="$@"
  32.  
  33. until PGPASSWORD=$POSTGRES_PASSWORD psql -h "$host" -U "MySql" -c 'q'; do
  34. >&2 echo "MySql is unavailable - sleeping"
  35. sleep 1
  36. done
  37.  
  38. >&2 echo "MySql is up - executing command"
  39. exec $cmd
  40.  
  41. Unhandled Exception: System.FormatException: Value for switch '/app/entrypoint.sh' is missing.
  42. test | at Microsoft.Extensions.Configuration.CommandLine.CommandLineConfigurationProvider.Load()
  43. test | at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
  44. test | at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
  45. test | at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
  46. test | at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
  47. test | at test.Program.Main(String[] args) in /app/Program.cs:line 19
  48.  
  49. #!/bin/bash
  50.  
  51. set -e
  52. run_cmd="dotnet run --server.urls http://*:80"
  53.  
  54. until dotnet ef database update; do
  55. >&2 echo "SQL Server is starting up"
  56. sleep 1
  57. done
  58.  
  59. >&2 echo "SQL Server is up - executing command"
  60. exec $run_cmd
Add Comment
Please, Sign In to add comment