Skip to content

Commit

Permalink
update to latest mssql/server image
Browse files Browse the repository at this point in the history
  • Loading branch information
max-ieremenko committed Nov 4, 2024
1 parent d24ba6e commit 40f92bc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
14 changes: 10 additions & 4 deletions Examples/SqlServerDockerImage/create-database.dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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
Expand All @@ -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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down

0 comments on commit 40f92bc

Please sign in to comment.