jfiggins
jfiggins

Reputation: 129

Is there a way to allocate memory to a container in the toolbox version of docker?

So I have a container, and to create it in docker toolbox I used:

docker run --memory=4096m -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=MY_PASSWORD' -p 1433:1433 -d --name CONTAINER_NAME microsoft/mssql-server-linux

I have different names and password, but I swapped those out. Every time I run that, it creates, but then exits immediately. When I use:

docker ps -a

to check on it, under status it says:

Exited (1) 7 minutes ago

and then when I try to run:

docker logs CONTAINER_NAME

to check what happened, I get an error saying:

sqlservr: This program requires a machine with at least 2000 megabytes of memory.

My computer has plenty of ram available, and when I created the container I gave it 4gb of ram, so I don't understand what the issue is here. Also, I cannot use docker for windows.

Upvotes: 1

Views: 432

Answers (1)

jfiggins
jfiggins

Reputation: 129

The fix was to remove the "default" vm that gets created automatically, using:

docker-machine rm default

and then re-creating it with the command:

docker-machine -D create -d virtualbox --virtualbox-memory 8096 --virtualbox-disk-size "100000" default

which gives it 8 gigs of memory and 100 gigs of disk space. Also, renaming it as default keeps Kitematic working, which is a plus.

Upvotes: 3

Related Questions