mssql-docker
mssql-docker copied to clipboard
Docker for Windows mssql-server-linux:latest fails to run due to memory limit
I may be doing this wrong...
Docker: 18.04.0-ce-win62 (17151) image: microsoft/mssql-server-linux:latest
I'm just trying to run the following:
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=supersecret" -p 1417:1433 --name sql17 --platform linux -d microsoft/mssql-server-linux:latest
I can see the container in VS Code created and started, but then immediately stops. I check the logs:
docker logs sql17 --tail 50 -f
sqlservr: This program requires a machine with at least 2000 megabytes of memory.
So I saw mention in another issue about -e "MSSQL_MEMORY_LIMIT_MB=3072" so I tried that but still gets the same error.
Am I doing something wrong?
if you are literally using supersecret as your password it isnt meeting complexity requirements. You can run it without -d to see the output and see if there is anything useful there.
Oh, you twisted my arm...I'll release my super secret password...but all the output I get is the same.

I'm pulling down the Ubunut:latest image to just see if I can get it to run. It may be just an issue with trying to run Linux over Windows mode...
Ah ha! You are hitting this issue where Linux Containers on Windows (LCOW) is limited to max 2GB of memory. https://github.com/Microsoft/opengcs/issues/145
I wonder why the that image is an issue because this works with no issue:
docker run -it --platform linux ubuntu:latest

The vanilla ubuntu VM can probably easily run with less than 2GB of RAM. SQL Server requires 2 GB+ of RAM. The error message you see there comes from sqlservr. It's a resource prerequisite check we do on start up of the sqlservr process.
I've read that there are options to reduce the memory usage of SQL Server. Is there a way to set those via the docker env file?
You can control the amount of memory that SQL Server uses by passing the MSSQL_MEMORY_LIMIT_MB environment variable. SQL Server on Linux does need a minimum of 2GB of memory though for now.
Looks like the option to configure the VM memory is back in the more recent versions of Docker for Windows. Can you please try changing this from the default 2 GB to 4 GB or something and try running SQL Server on Linux again? Should work now.

Those options are not available under Windows Mode. I'm using the platform option to run a Linux container under Windows Mode.
I'm running into the same extremely annoying issue.
Hello, I am facing the same issue using the latest docker version( 18.09.0-ce-beta1), i can;t start sqlsrv linux contaner: "sqlservr: This program requires a machine with at least 2000 megabytes of memory." I don't what to to fix it!.Can you help me out with this one,please? Thank you!
The 2GB minimum does not seem sensible to me.
Does really empty sqlsrv needs that much memory just to start? I understand there may be some (potentially big) performance degradation for bigger tables and bigger indices, but it does not seem sensible to beef up the machine just to create a table with 20 rows for Travis build. Production (!) and fast enough MySQL/MariaDB for small web can run on 512M DigitalOcean droplet along with httpd and standard Debian.
@tomasfejfar There's a bit more to it than just simply running SQL Server. Keep in mind that SQL Server on Linux runs inside of a platform abstraction layer (PAL). More detailed reading. The additional memory required to run the PAL itself is a big part of the overall memory demands of running SQL Server in as small of a footprint as possible. On a production system with 1 TB of RAM available the extra 512MB-1 GB to run the PAL is negligible, but when you are trying to run some CI tests on as small of a footprint as possible, it's completely understandable to want to minimize the memory consumption. We're working on reducing the memory footprint, but it will take some time. Hope that provides a bit more context.
That's much more context, thanks. And the link provided me with much deeper understanding. My understanding was pretty much limited to "it's probably just C, so not much different from other RDBMS".
Any Status update on this?
Bumping this to see if anyone has looked into it or if there is a roadmap to support this eventually again.
Bumping this to see if anyone has looked into it or if there is a roadmap to support this eventually again.
We don't have anything to share at the moment. We are actively investigating how we can support this in production. Once we have support for the same, we will make a formal announcement and also update this thread.
I have the following environment within my windows 10: Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24302 Built: Fri Mar 23 08:31:36 2018 OS/Arch: windows/amd64 Experimental: false Orchestrator: swarm
Server: Docker Engine - Community Engine: Version: 18.09.1 API version: 1.39 (minimum version 1.12) Go version: go1.10.6 Git commit: 4c52b90 Built: Wed Jan 9 19:41:57 2019 OS/Arch: linux/amd64 Experimental: false
Before running the following command: docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=password' -p 1401:1433 microsoft/mssql-server-linux
I have set the limit on virtualbox for base memory to 2048 mb and it works properly
Not using vbox, using hyper-v default docker machine and will not be able to setup or push for vbox every where On Mon, Feb 11, 2019 at 2:02 PM Fatlonder [email protected] wrote:
I have the following environment withing my windows 10: **Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24302 Built: Fri Mar 23 08:31:36 2018 OS/Arch: windows/amd64 Experimental: false Orchestrator: swarm
Server: Docker Engine - Community Engine: Version: 18.09.1 API version: 1.39 (minimum version 1.12) Go version: go1.10.6 Git commit: 4c52b90 Built: Wed Jan 9 19:41:57 2019 OS/Arch: linux/amd64 Experimental: false**
Before running the following command: docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=password' -e 'MSSQL_MEMORY_LIMIT_MB = 4000m' -p 1401:1433 microsoft/mssql-server-linux
I have set the limit on virtualbox for base memory to 2048 mb and it works properly
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/mssql-docker/issues/293#issuecomment-462451734, or mute the thread https://github.com/notifications/unsubscribe-auth/ACgvXOQntV2dSj_ocMPh-XcXVOTSVWk3ks5vMb5CgaJpZM4TeDRZ .
Not using vbox, using hyper-v default docker machine and will not be able to setup or push for vbox every where … On Mon, Feb 11, 2019 at 2:02 PM Fatlonder @.***> wrote: I have the following environment withing my windows 10: Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24302 Built: Fri Mar 23 08:31:36 2018 OS/Arch: windows/amd64 Experimental: false Orchestrator: swarm Server: Docker Engine - Community Engine: Version: 18.09.1 API version: 1.39 (minimum version 1.12) Go version: go1.10.6 Git commit: 4c52b90 Built: Wed Jan 9 19:41:57 2019 OS/Arch: linux/amd64 Experimental: false Before running the following command: docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=password' -e 'MSSQL_MEMORY_LIMIT_MB = 4000m' -p 1401:1433 microsoft/mssql-server-linux I have set the limit on virtualbox for base memory to 2048 mb and it works properly — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#293 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ACgvXOQntV2dSj_ocMPh-XcXVOTSVWk3ks5vMb5CgaJpZM4TeDRZ .
Can't you change the memory limit on hyper-v as well? I guess there should be an option
You have to change them using docker flags with Linux containers but when you are using mixed mode containers I.e. windows containers along side Linux containers
Docker throws an error saying that memory resource allocation is not supported On Fri, Feb 15, 2019 at 4:27 PM Fatlonder [email protected] wrote:
Not using vbox, using hyper-v default docker machine and will not be able to setup or push for vbox every where … <#m_-636101805999469629_> On Mon, Feb 11, 2019 at 2:02 PM Fatlonder @.***> wrote: I have the following environment withing my windows 10: Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24302 Built: Fri Mar 23 08:31:36 2018 OS/Arch: windows/amd64 Experimental: false Orchestrator: swarm Server: Docker Engine - Community Engine: Version: 18.09.1 API version: 1.39 (minimum version 1.12) Go version: go1.10.6 Git commit: 4c52b90 Built: Wed Jan 9 19:41:57 2019 OS/Arch: linux/amd64 Experimental: false Before running the following command: docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=password' -e 'MSSQL_MEMORY_LIMIT_MB = 4000m' -p 1401:1433 microsoft/mssql-server-linux I have set the limit on virtualbox for base memory to 2048 mb and it works properly — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#293 (comment) https://github.com/Microsoft/mssql-docker/issues/293#issuecomment-462451734>, or mute the thread https://github.com/notifications/unsubscribe-auth/ACgvXOQntV2dSj_ocMPh-XcXVOTSVWk3ks5vMb5CgaJpZM4TeDRZ .
Can't you change the memory limit on hyper-v as well? I guess there should be an option
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/mssql-docker/issues/293#issuecomment-464206740, or mute the thread https://github.com/notifications/unsubscribe-auth/ACgvXHB9OKTivoryK7NMrFc3obfqIhKgks5vNyZTgaJpZM4TeDRZ .
Hi,
Any updates on this issue with Windows mixed containers?
👍 on not working in mixed mode Windows containers, no (apparent) way of increasing the Docker VM memory
Got tired of waiting and refocused effort in getting kubernetes cluster in azure working :/ On Fri, Mar 22, 2019 at 12:41 AM Simon [email protected] wrote:
+1 on not working in mixed mode Windows containers, no (apparent) way of increasing the Docker VM memory
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/mssql-docker/issues/293#issuecomment-475491989, or mute the thread https://github.com/notifications/unsubscribe-auth/ACgvXKsR8B8bhUR0JsXq5ZnxbbaaMDzJks5vZF7-gaJpZM4TeDRZ .
@wsmelton
I made a docker image that works around this memory (limitation) policy: https://github.com/justin2004/mssql_server_tiny
ı waste lots of time about this issue and ı couldnt find any solution. maybe @justin2004 ' image can solve this problem .. Does anyone try this ?
I had the same issue. Here is what I did to solve it:
-
In the Windows Docker app right click and switch to Linux container

-
Open Settings and select Advanced (make it 3g)

-
then just run in bash or powershell: docker run --name demoSQLServer
-p 1431:1433
-e "ACCEPT_EULA=Y"
-e "SA_PASSWORD=1qaz.@WSX"
-d microsoft/mssql-server-linux:latest
@justin2004 I just came back to see if there was any status changes on this since my post last year and I see your branch as a viable Option. Again a lot of people do not realize that the issue is when they are trying to run mixed containers (linux containers running in windows mode with LCOW). Anyways, Justin I am going to pull your branch and see if I can implement your solution as one viable way to get it running in a container in linux running in mixed mode for windows