In a previous post, I wrote about setting up SQL Server 2019 via Docker container on Windows 10. Microsoft has championed the fact that they support more than just Windows. I decided to put that to the test and try running SQL Server 2019 on on Mac OS X using Docker. I figure Docker is Docker on pretty much everywhere it’s running, so this should be a piece of cake.
Assumption - Docker is already running on your Windows 10 computer. I’m making this assumption to avoid walking through install and setup of Docker on Mac OS X.
Step 1. Download the Software
Downloading the software works the same as it does on Windows or any other platform. At the time of this writing, the container label is “vNext-CTP2.0-ubuntu“ and it can be found on docker hub at “docker pull mcr.microsoft.com/mssql/server .”
The full pull command looks like this:
docker pull mcr.microsoft.com/mssql/server:vNext-CTP2.0-ubuntu
Step 2. Run the Downloaded Container
Running the container is next. When the SQL Server container is run, the End User License Agreement (EULA) must be accepted and a password set for the container to execute. For the purpose of this demo, I’ll use a simple password of “Password1234".” Such a simple password is not recommended for production.
The port for accessing the SQL Server instance in the container must also be set. Changing the port is useful for a number of reasons, The most useful one I’ve found is running multiple SQL Server containers on the same host. In this example, I’ll keep the port at the default of 1433.
The command to run the container is
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Password1234" -p1433:1433 --name sql2019 -d mcr.microsoft.com/mssql/server:vNext-CTP2.0-ubuntu
The running state of the container can be checked by issuing the command
The SQL Server is available for connections once the state is confirmed as running.
Step 3. Connect to SQL Server
Microsoft recently renamed the SQL Operations Studio as Azure Data Studio. Azure Data Studio is available on Windows, Mac, and Linux. The connection will be made using the local sa account and the password supplied when running the container.
That’s it! The container works and functions the same as any other SQL Server would behave. Containerized instances are simple to setup and allow for testing and experimentation on platforms that were previously off limits.