@@ -86,15 +86,15 @@ export const COMMANDS = {
8686 GET_CONTAINERS : `docker ps -a --format "{{.ID}}"` ,
8787 GET_CONTAINERS_BY_NAME : `docker ps -a --format "{{.Names}}"` ,
8888 INSPECT : ( id : string ) => `docker inspect ${ id } ` ,
89- PULL_IMAGE : ( version : string ) => `docker pull mcr.microsoft.com/mssql/server:${ version } -latest ` ,
89+ PULL_IMAGE : ( versionTag : string ) => `docker pull mcr.microsoft.com/mssql/server:${ versionTag } ` ,
9090 START_SQL_SERVER : (
9191 name : string ,
9292 password : string ,
9393 port : number ,
94- version : string ,
94+ versionTag : string ,
9595 hostname : string ,
9696 ) =>
97- `docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=${ password } " -p ${ port } :${ defaultPortNumber } --name ${ name } ${ hostname ? `--hostname ${ sanitizeContainerInput ( hostname ) } ` : "" } -d mcr.microsoft.com/mssql/server:${ version } -latest ` ,
97+ `docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=${ password } " -p ${ port } :${ defaultPortNumber } --name ${ name } ${ hostname ? `--hostname ${ sanitizeContainerInput ( hostname ) } ` : "" } -d mcr.microsoft.com/mssql/server:${ versionTag } ` ,
9898 CHECK_CONTAINER_RUNNING : ( name : string ) =>
9999 `docker ps --filter "name=${ sanitizeContainerInput ( name ) } " --filter "status=running" --format "{{.Names}}"` ,
100100 VALIDATE_CONTAINER_NAME : 'docker ps -a --format "{{.Names}}"' ,
@@ -380,12 +380,25 @@ export async function getDockerPath(executable: string): Promise<string> {
380380 return "" ;
381381}
382382
383+ /**
384+ * Temp fix for the SQL Server 2025 version issue on Mac.
385+ * Returns the last working version of SQL Server 2025 for Mac.
386+ */
387+ export function constructVersionTag ( version : string ) : string {
388+ let versionYear = version . substring ( 0 , yearStringLength ) ;
389+ // Hard Coded until this issue is fixed for mac: https://github.com/microsoft/mssql-docker/issues/940#issue
390+ if ( platform ( ) === Platform . Mac && arch ( ) !== x64 && versionYear === "2025" ) {
391+ return "2025-CTP2.0-ubuntu-22.04" ; // Last working version of SQL Server 2025 for Mac
392+ }
393+ return `${ versionYear } -latest` ;
394+ }
395+
383396/**
384397 * Pulls the SQL Server container image for the specified version.
385398 */
386399export async function pullSqlServerContainerImage ( version : string ) : Promise < DockerCommandParams > {
387400 try {
388- await execCommand ( COMMANDS . PULL_IMAGE ( version . substring ( 0 , yearStringLength ) ) ) ;
401+ await execCommand ( COMMANDS . PULL_IMAGE ( constructVersionTag ( version ) ) ) ;
389402 return { success : true } ;
390403 } catch ( e ) {
391404 return {
@@ -410,7 +423,7 @@ export async function startSqlServerDockerContainer(
410423 containerName ,
411424 password ,
412425 port ,
413- version . substring ( 0 , yearStringLength ) ,
426+ constructVersionTag ( version ) ,
414427 hostname ,
415428 ) ;
416429 try {
0 commit comments