4

I'm a Docker newbie and tried to resolve the issue after checking similar SO questions without success. So please don't mark it as a duplicate .

Issue :

The container always exits immediately after its created and running.

I have tried to run the mssql instance using command

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Technocrat123’ -p 1433:1433 -d microsoft/mssql-server-linux  

when trying as similar SO link link

$ docker run -t -d --name microsoft/mssql-server-linux 0adcdf822722

got the following error ,

Unable to find image '0adcdf822722:latest' locally
docker: Error response from daemon: repository 0adcdf822722 not found: does not exist or no pull access.

when tried to kill the process referring link1

Kill: illegal process id: PID

I'm using a mac machine. Thanks in advance.

Edit : After running the log after run command like

 docker logs 0adcdf822722

it shows

This is an evaluation version.  There are [160] days left in the evaluation period.
The SQL Server End-User License Agreement (EULA) must be accepted before SQL
Server can start. The license terms for this product can be downloaded from
http://go.microsoft.com/fwlink/?LinkId=746388.

You can accept the EULA by specifying the --accept-eula command line option,
setting the ACCEPT_EULA environment variable, or using the mssql-conf tool.

But already in the run command I have set 'ACCEPT_EULA=Y'.

user2695433
  • 1,553
  • 4
  • 18
  • 42
  • when your container exists (after doing the first command `docker run -e 'ACC...`. Perform `docker ps -a` to see the stopped container and check the logs with `docker logs container-id`. What are they showing? – lvthillo Aug 16 '17 at 08:07
  • I've executed the same command, so the image is pulled from https://hub.docker.com/r/microsoft/mssql-server-linux/ and it's running fine for me. Do you have sufficient memory? – lvthillo Aug 16 '17 at 08:08
  • @lvthillo , I have added the logs . I have set 4 gb memory . – user2695433 Aug 16 '17 at 08:14
  • 1
    Hmm, when I check your run command it contains a bad quote but that's maybe because of the copy/paste. Maybe try to delete this container with `docker rm -fv container-id` and try it again by retyping the command or copying it from docker hub? – lvthillo Aug 16 '17 at 08:22
  • @lvthillo I will try it – user2695433 Aug 16 '17 at 09:36
  • @lvthillo thanks alot for pointing out the typo. – user2695433 Aug 16 '17 at 09:45

4 Answers4

4

This worked for me:

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Sprpwd1234" --name sql_server_dev -p 1433:1433 -d store/microsoft/mssql-server-linux:2017-GA 

Using (") instead of ('). Running Docker on Windows 10.

Mr. D MX
  • 488
  • 7
  • 18
3

Your password (such as Technocrat123) doesn't meet the complexity requirements. So try adding a non-alphanumeric characters such as exclamation point (!). Secondly, use double quotes instead of single.

To check for errors, run: docker logs ID (where ID is container ID from docker ps).

kenorb
  • 118,428
  • 63
  • 588
  • 624
2

There is a typo in the command you are running:

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Technocrat123’ -p 1433:1433 -d microsoft/mssql-server-linux  

'Technocrat123’ should be 'Technocrat123'. The typo is in the end: ’ vs '.

The correct command is:

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Technocrat123' -p 1433:1433 -d microsoft/mssql-server-linux  
yamenk
  • 33,910
  • 9
  • 61
  • 67
1

I was running Docker on Mac and trying to install sql-server. Initially, I was pasting the command provided here - https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker changing password. Then I would try to run the docker image. This gave me the said error "This is an evaluation version.....". I did an additional step, after running the command on the above link. I ran it again as docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=Very_StrongPassword' -p 1401:1433 microsoft/mssql-server-linux:2017-latest. This kicked off installation of sql-server. This installation takes around 20-30 mins. Then the docker image is ready to use.