I have the following docker file in Visual studio:
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
EXPOSE 1433
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
COPY ["src", ""]
COPY ["NuGet.Config", ""]
COPY ["test", "test"]
COPY ["*.sln", ""]
#RUN dotnet restore --configfile NuGet.Config "Security.WebApi/Security.WebApi.csproj"
COPY . .
WORKDIR "/src/src/WebApi.WebApi"
RUN dotnet build "WebApi.WebApi.csproj" -c Release -o /app/build
#### Run all tests in sln ####
WORKDIR /src
RUN dotnet test "HSB.Webapi.sln" "--logger:trx"
WORKDIR "/src/src/Webapi.WebApi"
#### END OF TESTS ####
FROM build AS publish
RUN dotnet publish "Webapi.WebApi.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Webapi.WebApi.dll"]
This gives me a container where I can build and run my .NET application.
However, now I want to install SQL Express as well. How can I do this in the docker file above? I want to install and start sql express when the container is started.
I have tried to add this:
FROM microsoft/mssql-server-linux:latest
COPY ./create-db.sql .
ENV ACCEPT_EULA Y
ENV sa_password fisk1234
ENV MSSQL_TCP_PORT=1433
CMD /opt/mssql/bin/sqlservr
But that don't work.