diff --git a/Examples/SqlServerDockerImage/create-database.dockerfile b/Examples/SqlServerDockerImage/create-database.dockerfile index 2cf2e4a6..8b3112f2 100644 --- a/Examples/SqlServerDockerImage/create-database.dockerfile +++ b/Examples/SqlServerDockerImage/create-database.dockerfile @@ -1,4 +1,4 @@ -FROM microsoft/mssql-server-linux:latest AS build +FROM mcr.microsoft.com/mssql/server:latest AS build ENV ACCEPT_EULA=Y \ SA_PASSWORD=P@ssw0rd \ @@ -7,11 +7,14 @@ ENV ACCEPT_EULA=Y \ # copy scripts COPY create-database-scripts/ /sql-scripts/ -# install .net 6.0 sdk +# switch to root +USER root + +# install .net 8.0 sdk RUN apt-get update && \ apt-get install -y apt-transport-https && \ apt-get update && \ - apt-get install -y dotnet-sdk-6.0 + apt-get install -y dotnet-sdk-8.0 # install SqlDatabase.GlobalTool RUN dotnet tool install --global SqlDatabase.GlobalTool @@ -27,7 +30,10 @@ RUN /opt/mssql/bin/sqlservr & \ -from=/sql-scripts && \ pkill sqlservr -FROM microsoft/mssql-server-linux:latest AS runtime +# set mssql user as SqlServer files owner +RUN chown -R mssql /var/opt/mssql/data + +FROM mcr.microsoft.com/mssql/server:latest AS runtime ENV ACCEPT_EULA=Y \ SA_PASSWORD=P@ssw0rd \ diff --git a/Examples/SqlServerDockerImage/upgrade-database-scripts.dockerfile b/Examples/SqlServerDockerImage/upgrade-database-scripts.dockerfile index 1b4fba3e..074c119e 100644 --- a/Examples/SqlServerDockerImage/upgrade-database-scripts.dockerfile +++ b/Examples/SqlServerDockerImage/upgrade-database-scripts.dockerfile @@ -4,11 +4,14 @@ FROM sqldatabase/mssql-server-linux-demo:create AS build # copy scripts COPY upgrade-database-scripts/ /sql-scripts/ -# install .net 6.0 sdk +# switch to root +USER root + +# install .net 8.0 sdk RUN apt-get update && \ apt-get install -y apt-transport-https && \ apt-get update && \ - apt-get install -y dotnet-sdk-6.0 + apt-get install -y dotnet-sdk-8.0 # install SqlDatabase.GlobalTool RUN dotnet tool install --global SqlDatabase.GlobalTool @@ -24,7 +27,10 @@ RUN /opt/mssql/bin/sqlservr & \ -from=/sql-scripts && \ pkill sqlservr -FROM microsoft/mssql-server-linux:latest AS runtime +# set mssql user as SqlServer files owner +RUN chown -R mssql /var/opt/mssql/data + +FROM mcr.microsoft.com/mssql/server:latest AS runtime ENV ACCEPT_EULA=Y \ SA_PASSWORD=P@ssw0rd \