microsoft / mssql-docker

Official Microsoft repository for SQL Server in Docker resources
MIT License
1.72k stars 757 forks source link

Licensing unclarity #200

Closed bloodybeet closed 6 years ago

bloodybeet commented 6 years ago

We're looking into running SQL Server as a container in a production environment. I read before that the normal licensing model applies, but there isn't any direction to how this works in practise. Where do I enter my product key? What if I spin up multiple containers?

Also seems like the actual Windows based MSSQL image is taken down? It used to be at https://hub.docker.com/r/microsoft/mssql-server-windows/

twright-msft commented 6 years ago

You dont need to enter a product key for SQL Server on Linux. You just pass the MSSQL_PID environment variable and specify Enterprise, Standard, Web, Express. Details can be found here: https://hub.docker.com/r/microsoft/mssql-server-linux/

You can have multiple containers but they each need to be licensed. You can read about the different options for licensing SQL Server in containers in the licensing data sheet here: https://www.microsoft.com/en-us/sql-server/sql-server-2017-pricing

There are two Windows SQL Server images:
https://hub.docker.com/r/microsoft/mssql-server-windows-developer/ https://hub.docker.com/r/microsoft/mssql-server-windows-express/ Keep in mind that Windows-based SQL Servers are not supported in production. Only the Linux-based containers.

bloodybeet commented 6 years ago

OK, we would very much like to switch to Linux-based docker containers for SQL Server, but the obvious DB attachment functionality is missing there. Is this going to be added as well?

twright-msft commented 6 years ago

Probably at some point. In the meantime, you can create use sqlcmd to attach the DB in your own Dockerfile. You can get some ideas on how to do this from this project: https://github.com/twright-msft/mssql-node-docker-demo-app

bloodybeet commented 6 years ago

Thanks for clarifying. Going back to the MSSQL_PID to be passed to the container:

Developer : This will run the container using the Developer Edition (this is the default if no MSSQL_PID environment variable is supplied) Express : This will run the container using the Express Edition Standard : This will run the container using the Standard Edition Enterprise : This will run the container using the Enterprise Edition EnterpriseCore : This will run the container using the Enterprise Edition Core

: This will run the container with the edition that is associated with the PID If I simply pass in "Standard", it means it will be running a fully featured "Standard" edition, but as a "trial" or something? What stops us from simply running any edition just like that?
twright-msft commented 6 years ago

Yes, if you pass Standard, it is a fully featured, unlimited Standard instance. It's not a trial. The only thing that "stops" you from using Standard edition without paying for it is the license agreement that you accept with ACCEPT_EULA=Y. The terms of the EULA state that if you use a paid edition like Standard, Enterprise, etc. then you do need to pay for it of course, but we don't try to enforce the payment in some technical way at the time that you start the container.

nburoojy commented 6 years ago

@twright-msft I'm still a little unclear about the licensing and evaluation versions. For example, when I start the linux container store/microsoft/mssql-server-linux:2017-CU1 with an Express PID, I see this in the docker logs

This is an evaluation version.  There are [48] days left in the evaluation period.
2017-12-06 19:38:17.33 Server      Microsoft SQL Server 2017 (RC2) - 14.0.900.75 (X64)
        Jul 27 2017 08:53:49
        Copyright (C) 2017 Microsoft Corporation
        Express Edition (64-bit) on Linux (Ubuntu 16.04.3 LTS)

What will happen in 48 days? Are there separate production and evaluation docker images?

twright-msft commented 6 years ago

@nburoojy - Something doesnt add up here. The tag you said you are using it 2017-CU1, but the output from the log is RC2. Pre-GA builds are timebombed to expire in 180 days from the day of the build. After GA, including CU builds, there is no timebomb. Can you please double check that you are using an image which is tagged as GA+?

nburoojy commented 6 years ago

Thanks for the info @twright-msft

I double-checked and it looks like my image installed a package from https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list on top of the mssql docker image which effectively replaced the sqlserver install with a pre-GA version. I've updated this to https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list and no longer see the timebomb.

Thanks!

twright-msft commented 6 years ago

OK, good yeah, that would be the problem. Glad you were able to figure it out. If your goal is to always have latest in your image you can use the :latest (latest regardless of version) or :2017-latest (latest within the 2017 version) tag in your FROM in your Dockerfile.

oguzCoel commented 6 years ago

We have license for the 2016 Enterprise edition. Is the license valid also for docker container (2017 version)? Or do we have order a new license? I could not find any official docker image for 2016.

twright-msft commented 6 years ago

That depends on how you purchased your SQL Server 2016 license. If you bought it with Software Assurance, then that will cover you for using it on SQL Server 2017. There isn't a container image for SQL Server 2016 right now and no plans for that for the foreseeable future.

gedbac commented 5 years ago

Is it license violation, if I am going to run SQL Server 2016 docker image with "MSSQL_PID: Web" on azure cloud?

We want to replace exiting VM with docker container and I see in documentation that "Web" edition is listed in list of MSSQL_PID possible values.

twright-msft commented 5 years ago

Whatever licensing policies apply to SQL Server also apply to running SQL Server in a container. Web edition is listed there as an option for completeness, but please use the editions in compliance with the software use right of the license you have.

natalie-o-perret commented 4 years ago

@twright-msft

Not sure to get this right, but is it allowed to use the Express version in a corporate setting for running integration tests in a CI/CD pipeline?

docker run --name 'MySqlServer' -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=MyPassword!' -e 'MSSQL_PID=Express' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest-ubuntu

According to: https://www.microsoft.com/en-us/sql-server/sql-server-2017-pricing I'd say yes, but not sure if I'm missing out something.

nidhinjames commented 3 years ago

I am using the following SQL docker server Microsoft SQL Server 2019 (RTM-CU8) (KB4577194) - 15.0.4073.23 (X64) Sep 23 2020 16:03:08 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Linux (Ubuntu 18.04.5 LTS) I want to upgrade the license to Standard Edition. How can I do that without losing the data in my docker container?

asirisam commented 2 years ago

Hi All,

I need to install mssql docker in ubuntu. I tried developer mode, standard mode and I can see that it is perfectly added. But when I tried to add the product key in MSSQL_PID environment variable, docker status is shown as Exited. I have run the command as follows. This Product Key is for MSSQL Standard.

sudo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=A1234-B5678-C9012-D3456-E7890" -e "SA_PASSWORD=TestPassword" \ -p 1433:1433 --name sql1 --hostname sql1 \ -d mcr.microsoft.com/mssql/server:2019-latest

I would be appreciate if someone can mention whether is there is wrong in the above command?

stevenobird commented 2 years ago

Hi All,

I need to install mssql docker in ubuntu. I tried developer mode, standard mode and I can see that it is perfectly added. But when I tried to add the product key in MSSQL_PID environment variable, docker status is shown as Exited. I have run the command as follows. This Product Key is for MSSQL Standard.

sudo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=A1234-B5678-C9012-D3456-E7890" -e "SA_PASSWORD=TestPassword" -p 1433:1433 --name sql1 --hostname sql1 -d mcr.microsoft.com/mssql/server:2019-latest

I would be appreciate if someone can mention whether is there is wrong in the above command?

According to the Documentation about environment variables, you can use your product key. I think your formatting in the executed command might be wrong, so maybe try this (check the changed positions and type of quotes):

docker run -e MSSQL_PID='A1234-B5678-C9012-D3456-E7890' -e MSSQL_SA_PASSWORD='TestPassword' -p 1433:1433 --name sql1 --hostname sql1 -d mcr.microsoft.com/mssql/server:2019-latest

EDIT: nevermind, the double quote version also works for me: docker run -e "MSSQL_PID=A1234-B5678-C9012-D3456-E7890" -e "MSSQL_SA_PASSWORD=TestPassword" -p 1433:1433 --name sql1 --hostname sql1 -d mcr.microsoft.com/mssql/server:2019-latest

I am used to make sure that no strings are getting parsed/processed by accident, so I tend to use single quotes for them. Also take a look on the password env variable, SA_PASSWORD is deprecated.

By checking the container's logs with docker logs sql1, I saw the following error message:

ERROR: The provided PID [A1234-B5678-C9012-D3456-E7890] is invalid. The PID must be in the form #####-#####-#####-#####-##### where '#' is a number or letter.

I don't know if SQL Server is not validating the key itself (because it is obviously a random one that won't work), or if the format is still not how SQL Server wants it to be.

EDIT: I've been googling for a not-paid licence to test if a product key works in general, and guess what it logged a different message:

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.

This command made my container spin up with more than 4 lines of logging: docker run -e MSSQL_PID='A1234-B5678-C9012-D3456-E7890' -e MSSQL_SA_PASSWORD='<YourStrong!Passw0rd>' -e ACCEPT_EULA=Y -p 1433:1433 --name sql1 --hostname sql1 -d mcr.microsoft.com/mssql/server:2019-latest

EDIT2: Also make sure that a more safe password is used, or the container will stop on its first start, logging this:

ERROR: Unable to set system administrator password: Password validation failed. The password does not meet SQL Server password policy requirements because it is not complex enough. The password must be at least 8 characters long and contain characters from three of the following four sets: Uppercase letters, Lowercase letters, Base 10 digits, and Symbols..

fuentco commented 2 years ago

Hello,

I have a working sql server in a docker container with the image mcr.microsoft.com/mssql/server:2019-CU12-ubuntu-20.04. Currently it has MSSQL_PID: "express".

When I try to change MSSQL_PID with a Standard product key I get the following message: Server ERROR: A failure occurred in the licensing subsystem. Error [-1979645951].

Any ideas on what could be happening?

michak89 commented 1 year ago

Server ERROR: A failure occurred in the licensing subsystem. Error [-1979645951]. Same problem here and no solution, ubuntu 20.04.2 lts, mssql-server 15.0.4316.3-2