Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM microsoft/aspnetcore-build:2.0 AS build-env
- WORKDIR /app
- # Copy csproj and restore as distinct layers
- COPY *.csproj ./
- RUN dotnet restore test.csproj
- # Copy everything else and build
- COPY . ./
- RUN dotnet publish -c Release -o out test.csproj
- # Build runtime image
- FROM microsoft/aspnetcore:2.0
- WORKDIR /app
- COPY ./entrypoint.sh ./app/
- RUN chmod +x ./app/entrypoint.sh
- CMD /bin/bash ./app/entrypoint.sh
- COPY --from=build-env /app/out .
- ENTRYPOINT ["dotnet", "test.dll"]
- #!/bin/bash
- # wait-for-MySql.sh
- set -e
- host="$1"
- shift
- cmd="$@"
- until PGPASSWORD=$POSTGRES_PASSWORD psql -h "$host" -U "MySql" -c 'q'; do
- >&2 echo "MySql is unavailable - sleeping"
- sleep 1
- done
- >&2 echo "MySql is up - executing command"
- exec $cmd
- Unhandled Exception: System.FormatException: Value for switch '/app/entrypoint.sh' is missing.
- test | at Microsoft.Extensions.Configuration.CommandLine.CommandLineConfigurationProvider.Load()
- test | at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
- test | at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
- test | at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
- test | at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
- test | at test.Program.Main(String[] args) in /app/Program.cs:line 19
- #!/bin/bash
- set -e
- run_cmd="dotnet run --server.urls http://*:80"
- until dotnet ef database update; do
- >&2 echo "SQL Server is starting up"
- sleep 1
- done
- >&2 echo "SQL Server is up - executing command"
- exec $run_cmd
Add Comment
Please, Sign In to add comment