Docker and AWS with MS Sql Server
Docker and AWS
with MS Sql Server
Docker does not have official MS Sql Server under Images like it should. So you will need to add MS Sql Server as an option.
For the latest MS SQL Server - Ubuntu based images to work with Docker:
docker pull mcr.microsoft.com/mssql/server:2025-latest
as found on: https://hub.docker.com/r/microsoft/mssql-server
Then you run:
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=YourStrongPassword" -p 1433:1433 --name sql_server_dev -d mcr.microsoft.com/mssql/server:2025-latest
of course changing: YourStrongPassword to be your password.
We need to do this with old SQL password rather than Windows Auth, since we will need to be AWS in Ubuntu.
When the command is run, a Windows prompt appears that you need to pick "Private networks" as the choice to open the port 1433 locally for Docker.
If a problem happens, you need to delete the stuck Docker container and fix the Windows Firewall permission you cancelled. To remove the stuck container, you run: docker rm -f sql_server_dev . To fix the firewall, you manually add a local inbound port rule of 1433.
Afterwards, you check that the process is running by:
docker ps
Use this command to check existing images:
docker images
In the future, you should be able to see and run the MS Sql Server image and container:
If you need to trigger the docker-compose.yml file from command line:
docker compose up -d
in the directory where the docker-compose.yml file is located.
- In the Connect to Server dialog box, enter the following exact settings:
- Server type:
Database Engine - Server name:
localhost,1433(The comma is important! It separates the address from the network port). - Authentication:
SQL Server Authentication - Login:
sa - Password:
YourStrongPassword123!(Use the exact password you typed in your docker-compose or run command).
- Server type:
- Go to the Connection Properties tab.
- Check the box for Trust server certificate. (Modern SQL Server 2022/2025 images encrypt traffic by default with a self-signed developer certificate, which SSMS will block unless you explicitly check this box).




Comments
Post a Comment