MSSQL via docker on Mac Apple M1 chip | not able to install - sql-server

I am using macOS Monterey with Apple M1 chipset and trying to install MS SQL via Docker while following this article: https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots=cs1-bash
once I am trying to run the server then getting this issue
â–¶ docker run -d --name example_sql_server -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=test#123' -p 1433:1433 mcr.microsoft.com/mssql/server:2019-latest
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
fcb5825617f24ab22a9e7c7b4707f7084ab3945e541c2c12a2e03285fa2baaae
While going through Microsoft mcr documentation then I am not able to find any 'linux/arm64/v8' compatible version, can someone please help me here to install SQL server on my machine.

Related

Unable to download SQL Server on M1 Mac [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 11 days ago.
Improve this question
I have been trying to download SQL Server on my Mac with an Apple Chip. I've been following the steps that include downloading docker and entering code into my terminal to set up the images and containers within docker. However, when I try and type in this code:
docker run --name SQLServer -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=12345OHdf%e' -e 'MSSQL_PID=Express’ -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
I get the following response in terminal:
WARNING: The requested image's platform (linux/amd64) does not match
the detected host platform (linux/arm64/v8) and no specific platform
was requested
a1c6173553fc3ae53d28cc4c8bef452fdd322bf1ab2074124803c2275a97e587
I was wondering if anybody would be able to help me in fixing this problem
Using the azure sql edge docker image and installing mssql tool separately worked for us.
This is the Dockerfile
FROM mcr.microsoft.com/azure-sql-edge:latest
EXPOSE 1433
COPY ./database/schema.sql /database/schema.sql
ENV SA_PASSWORD "MyP#w0rd"
ENV SQLCMDPASSWORD "MyP#w0rd"
ENV ACCEPT_EULA "Y"
RUN (mkdir -p /opt/mssql-tools/bin && cd /opt/mssql-tools/bin && wget https://github.com/microsoft/go-sqlcmd/releases/download/v0.8.0/sqlcmd-v0.8.0-linux-arm64.tar.bz2 \
&& bzip2 -d sqlcmd-v0.8.0-linux-arm64.tar.bz2 && tar -xvf sqlcmd-v0.8.0-linux-arm64.tar && chmod 755 sqlcmd)
RUN /opt/mssql/bin/sqlservr & sleep 20 && \
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -d master \
-Q "create database testdb;" && \
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -d master -i /database/schema.sql
CMD /opt/mssql/bin/sqlservr
From the docker docs:
"Not all images are available for ARM64 architecture. You can add
--platform linux/amd64 to run an Intel image under emulation. In particular, the mysql image is not available for ARM64. You can work
around this issue by using a mariadb image."
A bit late to the party but here's a workaround for this using an open source tool called Lima and Rosetta as the VM: https://dev.to/srburnham/forget-azure-sql-edge-on-a-m1-mac-run-full-blown-sql-server-linux-instead-a-how-to-6d2. Saves you from having to resort to the cutdown edge version.
I have followed the tutorial on the website but I can't connect azure data studio to the SQL Server instance ... while he is running
#Aaron Bertrand
I finally use Azure Sql Database instead of SSMS

apache-zeppelin 0.8.0 installation while using home brew on mac OS

i have installed java version "1.8.0_181", scala, apache-spark, apache-zeppelin using home brew, and there is no error showed up while these installations.
If i ran $ spark-shell in the terminal, it shows warn but still called up scala as below:
However, while i opened http://localhost:8080/#/ and ran sc.version, it shows error as bellow:
scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
at scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:102)
at scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:105)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:257)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:257)
at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1394)
at scala.tools.nsc.Global$Run.<init>(Global.scala:1215)
at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:432)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:855)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:813)
at scala.tools.nsc.interpreter.IMain.bind(IMain.scala:675)
at scala.tools.nsc.interpreter.IMain.bind(IMain.scala:712)
at scala.tools.nsc.interpreter.IMain$$anonfun$quietBind$1.apply(IMain.scala:711)
at scala.tools.nsc.interpreter.IMain$$anonfun$quietBind$1.apply(IMain.scala:711)
at scala.tools.nsc.interpreter.IMain.beQuietDuring(IMain.scala:214)
at scala.tools.nsc.interpreter.IMain.quietBind(IMain.scala:711)
at scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$loopPostInit(ILoop.scala:891)
at jdk.internal.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.zeppelin.spark.BaseSparkScalaInterpreter.callMethod(BaseSparkScalaInterpreter.scala:270)
at org.apache.zeppelin.spark.BaseSparkScalaInterpreter.callMethod(BaseSparkScalaInterpreter.scala:262)
at org.apache.zeppelin.spark.SparkScala211Interpreter.open(SparkScala211Interpreter.scala:84)
at org.apache.zeppelin.spark.NewSparkInterpreter.open(NewSparkInterpreter.java:102)
at org.apache.zeppelin.spark.SparkInterpreter.open(SparkInterpreter.java:62)
at org.apache.zeppelin.interpreter.LazyOpenInterpreter.open(LazyOpenInterpreter.java:69)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:617)
at org.apache.zeppelin.scheduler.Job.run(Job.java:188)
at org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:140)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)
how could i figure this problem?
I had multiple issues with home brew installation, but running with docker worked for me(http://zeppelin.apache.org/download.html#using-the-official-docker-image
):
"Use this command to launch Apache Zeppelin in a container.
docker run -p 8080:8080 --rm --name zeppelin apache/zeppelin:0.8.0
To persist logs and notebook directories, use the volume option for docker container.
docker run -p 8080:8080 --rm -v $PWD/logs:/logs -v $PWD/notebook:/notebook -e ZEPPELIN_LOG_DIR='/logs' -e ZEPPELIN_NOTEBOOK_DIR='/notebook' --name zeppelin apache/zeppelin:0.8.0
If you have trouble accessing localhost:8080 in the browser, Please clear browser cache."
In my case it was the problem of having a Java10 installed prior to Java8. Apparently, Java version above 8.0 are not yet supported by Spark. The problem is fixable by setting the JAVA_HOME environment variable to your Java8 installation.
If you don't have it:
brew cask install java8
and the default location for MacOs should be:
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home"
If you launch your zeppelin server via the zeppelin-deamon.sh, then just add the export above at the beginning of the file.
You should find the zepplin-deamon.sh true file location and if you installed zeppelin via homebrew, it should be in:
/usr/local/Cellar/apache-zeppelin/0.8.1/libexec/bin/zeppelin-daemon.sh

Unable to connect to remote SQL server from container

I'm trying to connect to my remote SQL server from a docker container hosted on my computer.
But are just reciving the following error:
A network-related or in stance-specific error has occurred while establishing a connection to SQL Server . Server is not found or not accessible. Check if instance name is correct and i f SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.. Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired.
But if I try to connect to my SQL server from SQL server management studio on the host machine everything works properly.
Also note that 2 weeks ago everything also worked inside the docker container.
Here is my docker compose file and the docker file which has the SQL driver installed:
Compose:
version: '3'
services:
nginx:
image: nginx:1.10
volumes:
- ./:/var/www
- .docker/nginx/vhost.conf:/etc/nginx/conf.d/default.conf
ports:
- ${DOCKER_IP}80:80
links:
- php
networks:
- app-net
php:
build:
context: ./
dockerfile: .docker/php/DockerFile
volumes:
- ./:/var/www
networks:
- app-net
networks:
app-net:
driver: bridge
Docker file
FROM phpdockerio/php71-fpm:latest
# Install selected extensions and other stuff
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && apt-get -y --no-install-recommends install \
php7.1-mysql \
php7.1-mbstring \
php7.1-gd \
php7.1-soap \
php7.1-dev \
apt-transport-https \
git \
ssh \
curl \
php-pear \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Install Composer
RUN cd /usr/src
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install MSSQL extention
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get -y install msodbcsql mssql-tools g++ unixodbc-dev make
RUN pear config-set php_ini `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` system
RUN pecl install sqlsrv
RUN pecl install pdo_sqlsrv
RUN echo "extension=sqlsrv.so" >> /etc/php/7.1/fpm/php.ini
RUN echo "extension=pdo_sqlsrv.so" >> /etc/php/7.1/fpm/php.ini
# Fixed locals for MSSQL extention
RUN apt-get install -y locales
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
RUN locale-gen
WORKDIR /var/www
Inside the docker container I can't ping the SQL server. So for me i sounds like a network issue, but I'm unable find a solution.
Please note the SQL server is hosted locally on a server in the office.
UPDATE/Solved for now
After downgrading the dokcer for windows to 18.03.0-CE everything worked as expected.
Docker Bridge networks don't connect to the world outside of Docker at all by default; they only allow containers to talk to each other. The documentation for Docker Bridge Networks does offer some advice for allowing Bridge network traffic to talk to the outside world by making changes on the Docker host:
First enable IP forwarding in the kernel:
$ sysctl net.ipv4.conf.all.forwarding=1
Then change the host firewall to allow the forwarding
$ sudo iptables -P FORWARD ACCEPT
This is a fairly permissive firewall configuration, so you may want to look at keeping that a bit more locked down.
The other way would be to attach the container to two different networks: your current bridge network for communication between container, and a second Host network for talking to MySQL. Since this bypasses all of Docker's NAT configuration, the scalability of your service may be impacted, although I think outgoing connections might be OK.
For my case:
I ran these below:
To see all containers:
docker ps -a
Then restart container:
docker container restart yourIdContainer
If there is error: Error response from daemon: Cannot restart container ...
Please restart Docker then restart container again.
Connect to Sql Server by MSSM, server name: localhost,1433 or IP
Hope this is helpful.
If you are using Windows 10 (HOME VERSION ) may you don't have the virtualization and you are using (docker toolbox ), they have solved the problem using a static ip. Check it.
I mean localhost won't work if you are using docker toolbox, search the ip where is virtualized docker toolbox.
My case ip: 192.168.99.100

How to install mssql in ubuntu 14.04

I want to install mssql with 2008/2012.Please suggest proper doc or steps to install.I have try to instaall from https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-setup-ubuntu but it give me follwoing error -
/opt/mssql/bin/sqlservr: /usr/lib/x86_64-linux-gnu/libsss_nss_idmap.so.0: no version information available (required by /opt/mssql/bin/sqlservr)
Starting Microsoft SQL Server...
sudo: systemctl: command not found
Error starting Microsoft SQL Server.
while run command -
sudo /opt/mssql/bin/mssql-conf setup
you can't install mssql in ubuntu 14.04..Docs clearly state supported versions
SQL Server vNext CTP 2.0 is supported on the following platforms:
Just to add ,I thought installing docker would support versions less than 16,but from docker file we could see below
Base OS layer: Latest Ubuntu LTS.
FROM ubuntu:16.04
which means it needs ubuntu:16.04 versions to be present
For a workaround, you can use run a Docker container (microsoft/mssql-server-linux), e.g.
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=yourStrongPassword!" -p 1433:1433 microsoft/mssql-server-linux
Then connect to localhost:1433 with your SQL client.
It is not possible to instal sql server 2008 or 2012 on any non window platform.
This feature came with 2016 or 2017.
https://www.microsoft.com/en-us/sql-server/sql-server-2017
You can't because You must have 16.04+ Ubuntu version to install MSSQL according to documentation.

Docker Keep Exiting (Deploying MS SQL on MAC osx)

I'm trying to deploy an MS SQL server on my MAC. There are several alternatives for that.
Here, I'm using docker: I've checked the MS-SQL website, and I executed this code:
docker run -e
'ACCEPT_EULA=Y'
-e 'SA_PASSWORD=<YourStrong!Passw0rd>' -p 1433:1433
-d microsoft/mssql-server-linux
However, The container keeps stopping by itself.
Did I miss something here?
The docker Version I'm using:
Version 1.13.0 (15072)
I had a similar problem. I finally realized the issue was that I was using a dummy password for local dev that didn't adhere to SQL Server's password policy. I used a more complex password and that fixed it up.
I faced this issue recently on Windows. Changing the ' quotes to " fixed the issue.
If you are using MacOS Ventura and/or using a Mac with M1/M2 (Apple Silicon) chip, you will need to enable the Rosetta Emulation to get this to work.
Go to Docker > Settings > Features in development and enable the option 'Use Rosetta for x86/amd64' emulation on Apple Silicon' and restart Docker.
Also, make sure the password obeys the Password Policy set by Microsoft and create a strong password.
Delete the container and re-run the docker run command. An example is below:
docker run -d -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Ithink%Th5r5f0re$Iam' --name sql_server --platform linux/amd64 -p 1433:1433 mcr.microsoft.com/mssql/server:2022-latest
This should get you run the container without the Exited(1) error.
This link explains the details:
https://devblogs.microsoft.com/azure-sql/development-with-sql-in-containers-on-macos/
When running this on Mac you need to bump up your Docker for Mac's RAM. SQL Server needs minimum 4GB RAM, Docker for Mac by default only allocates about 1-2GB for all containers.
To increase Docker for Mac's RAM:
Open Docker for Mac's preferences
Click "Resources"
Move the RAM slider up, in my case I moved it to 6GB (4GB for SQL Server and 2GB for everything else)
You also need to allocate 4GB to the container when starting it up:
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' --memory=4096M -p 1433:1433 -d microsoft/mssql-server-linux
To confirm you memory limits were applied run: docker stats. The MEM USAGE / LIMIT column for the SQL Server container should have output similar to: 536.7MiB / 4GiB
The other thing to watch out for on Mac is that you cannot mount volumes this will cause issues.

Resources