Created
September 7, 2022 14:46
-
-
Save dustinsoftware/69f842ff6aa5a292f4a9ca5c73107071 to your computer and use it in GitHub Desktop.
SQL Server on M1 macs using Lima
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# limactl start --name=sqlserver ~/Downloads/sqlserver.yaml | |
arch: "x86_64" | |
useHostResolver: false | |
dns: | |
- 8.8.8.8 | |
- 4.4.4.4 | |
images: | |
- location: "https://cloud-images.ubuntu.com/releases/20.04/release/ubuntu-20.04-server-cloudimg-amd64.img" | |
mounts: | |
- location: "~" | |
- location: "/tmp/lima" | |
writable: true | |
containerd: | |
system: false | |
user: false | |
portForwards: | |
- guestPort: 1433 | |
hostIP: "0.0.0.0" | |
provision: | |
- mode: system | |
script: | | |
#!/bin/sh | |
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | |
add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)" | |
apt-get update | |
apt-get install -y mssql-server | |
MSSQL_SA_PASSWORD=Supersecure! /opt/mssql/bin/mssql-conf -n setup accept-eula | |
probes: | |
- script: | | |
#!/bin/bash | |
set -eux -o pipefail | |
if ! timeout 30s bash -c "until nc -z localhost 1433; do sleep 3; done"; then | |
echo >&2 "sqlserver is not running yet" | |
exit 1 | |
fi | |
hint: | | |
SQL server is not up yet. | |
Run "limactl shell sqlserver sudo tail /var/log/syslog" to check the log. | |
message: | | |
SQL server is up! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment