1

I am running docker on my

windows 10 home

machine. So it is the older version of docker not the hyper v version.

I have setup a sql server docker container however when I run it it exits with the error

Exited (1)

When I look at the logs it says

sqlservr: This program requires a machine with at least 2000 megabytes of memory. /opt/mssql/bin/sqlservr: This program requires a machine with at least 2000 megabytes of memory.

However I have 8Gb of memory on my machine and I have at least 3.5 Gb free when running docker. I have tried using the --memory flag to allocate over 2Gb for the container (as the docs state that it needs 2Gb for the sql server image) but it still exits...

Does anyone know what is potentially the issue?

coolblue2000
  • 3,796
  • 10
  • 41
  • 62
  • check out this thread, check the memory within your container and see what you get first. https://stackoverflow.com/questions/43460770/docker-windows-container-memory-limit – runwuf Apr 16 '19 at 21:03
  • How do I check the memory inside the container when it exits as soon as it starts? – coolblue2000 Apr 16 '19 at 21:10
  • Can you increase the memory of the docker process? Right click on docker icon - Settings - Advanced and increase memory limit ti something bigger than 2gb.. – leopal Apr 17 '19 at 05:24
  • I do not have a docker icon... – coolblue2000 Apr 17 '19 at 06:07
  • I had similar Problems. My problem was that a Docker Container stops imideately when the job of the container stops. One can keep it running by start it with /bin/bash –  Nov 22 '19 at 21:16

2 Answers2

1

I had the same issue and I got it solved by using this docker image https://hub.docker.com/r/justin2004/mssql_server_tiny

this is my docker-compose file:

services:
  db:
    image: justin2004/mssql_server_tiny
    environment:
      - ACCEPT_EULA=Y
      - SA_PASSWORD=@P1ssword@
    ports:
      - '1433:1433'
    expose:
      - 1433
1

create .wslconfig file in your user folder

[wsl2]
memory=4GB   # Limits VM memory in WSL 2 up to GB
processors=2 # Makes the WSL 2 VM use two virtual processors