-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (29 loc) · 1.32 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# escape=`
# STAGE 1
# builder image
FROM dockersamples/assets-db-builder1 AS builder
WORKDIR C:\src
COPY src\Assets.Database-v1\ .
RUN msbuild Assets.Database.sqlproj `
/p:SQLDBExtensionsRefPath="C:\Microsoft.Data.Tools.Msbuild.10.0.61026\lib\net40" `
/p:SqlServerRedistPath="C:\Microsoft.Data.Tools.Msbuild.10.0.61026\lib\net40"
# STAGE 2
# db image
FROM microsoft/mssql-server-windows-express
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ADD https://download.microsoft.com/download/D/5/C/D5CFC940-DA21-44D3-84FF-A0FD147F1681/EN/x64/DacFramework.msi /DacFramework.msi
RUN Start-Process -FilePath 'msiexec.exe' `
-ArgumentList '/quiet','/qn','/norestart', `
'/log','\DacFramework.log', `
'/i','\DacFramework.msi' `
-Wait
VOLUME C:\database
ENV sa_password Qwerty123
WORKDIR C:\init
COPY Initialize-Database.ps1 Initialize-LocalDatabase.ps1 Initialize-RemoteDatabase.ps1 ./
CMD ./Apply-Database.ps1 -Verbose `
-sa_password $env:sa_password `
-user $env:remote_db_user `
-server $env:remote_db_server `
-server_password $env:remote_db_password
COPY --from=builder C:\src\bin\Debug\Assets.Database.dacpac .