UPDATE:SQL Server團隊現在保持對碼頭工人集線器2014快速的圖像:https://hub.docker.com/r/microsoft/mssql-server-2014-express-windows/
的SQL Server 2016目前正在安裝有點困難,但2014年工作正常。這是我的(略哈克)Dockerfile:
FROM microsoft/dotnet35
ENV SQL_EXPRESS_DOWNLOAD_URL "https://download.microsoft.com/download/1/5/6/156992E6-F7C7-4E55-833D-249BD2348138/ENU/x64/SQLEXPR_x64_ENU.exe"
ENV SQL_SERVER_SA_PASSWORD "Password1"
WORKDIR/
RUN powershell -Command (New-Object System.Net.WebClient).DownloadFile('%SQL_EXPRESS_DOWNLOAD_URL%', 'sqlexpress.exe')
RUN /sqlexpress.exe /qs /x:setup && /setup/setup.exe /q /ACTION=Install /INSTANCENAME=SQLEXPRESS /FEATURES=SQLEngine /UPDATEENABLED=0 /SECURITYMODE=SQL /SAPWD=%SQL_SERVER_SA_PASSWORD% /SQLSVCACCOUNT="NT AUTHORITY\System" /SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS" /TCPENABLED=1 /NPENABLED=0 /IACCEPTSQLSERVERLICENSETERMS && del /F /Q sqlexpress.exe && rd /q /s setup
RUN powershell -Command \
set-strictmode -version latest ; \
stop-service MSSQL`$SQLEXPRESS ; \
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql12.SQLEXPRESS\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpdynamicports -value '' ; \
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql12.SQLEXPRESS\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpport -value 1433 ; \
start-service MSSQL`$SQLEXPRESS
CMD powershell -Command while ($true) { Start-Sleep -Seconds 3600 }
EXPOSE 1433
它是基於這樣一個:https://github.com/brogersyh/Dockerfiles-for-windows/blob/master/sqlexpress/dockerfile
我猜我們可以在Mac,Ubuntu等上運行這個?只要我們安裝了碼頭引擎?或者它需要一些其他的MS依賴項? – Sobiaholic
@Sobiaholic它需要Windows內核和Windows Server 2016系統才能運行。在Linux或Mac上,您可以在虛擬機中運行它。 – friism