Skip to content

Commit

Permalink
Merge pull request #65 from max-ieremenko/example/sql-server
Browse files Browse the repository at this point in the history
update to latest mssql/server image
  • Loading branch information
max-ieremenko authored Nov 4, 2024
2 parents d24ba6e + 40f92bc commit f2f3b76
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 f2f3b76

Please sign in to comment.