This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15634|Reply: 14

[Source] Deploy SQL Server 2019 database on Docker

[Copy link]
Posted on 12/1/2021 9:13:44 PM | | | |
With the increasing popularity of containerization, Microsoft's SQL Server also supports running and deploying on Docker, and this article installs the SQL Server 2019 database on a CentOS 8 system with Docker containers installed.

Installation conditions:

Docker Engine 1.8+ on any supported Linux distribution or for Docker for Mac/Windows.
Docker overlay2 storage driver. This is the default setting for most users.
At least 2 GB of disk space.
At least 2 GB of RAM.

Pull the mirror

docker repository address:The hyperlink login is visible., the image is stored in Microsoft's private repository, but the page will announce version updates and other information.

The command is as follows:

Image Release Notes:

GA = General Availability - When a release is officially available and supported.
CU = Cumulative Updates - Released regularly, including bug fixes, security fixes, and the occasional minor feature.
CTP = Community Technology Preview - The preview version before the upcoming release of the new GA.
GDR = General Distribution Release - Contains only the version that contains the security fix.

environment variable

environment variable
illustrate
ACCEPT_EULA
Set the ACCEPT_EULA variable to any value to confirm acceptance of the End User License Agreement. Required settings for SQL Server images.
MSSQL_SA_PASSWORD
Configure the SA user password.
MSSQL_PID
Set the SQL Server version or product key. Possible values include:
compute
developer
Express
Web
standard
enterprise
Product key

If you specify a product key, it must be in the format #####-#####-#####-#####-#####, where "#" is a number or letter.
MSSQL_LCID
Set the language ID for SQL Server. For example, 1036 is in French.
MSSQL_COLLATION
Set the default collation for SQL Server. This overrides the Language ID (LCID) to the default mapping of the collation.
MSSQL_MEMORY_LIMIT_MB
Sets the maximum amount of memory (in MB) that SQL Server can use. By default, it is 80% of the total physical memory.
MSSQL_TCP_PORT
Configure the TCP port that SQL Server listens on (default is 1433).
MSSQL_IP_ADDRESS
Set the IP address. Currently, the IP address must be IPv4 style (0.0.0.0).
MSSQL_BACKUP_DIR
Set the default backup directory location.
MSSQL_DATA_DIR
Change the creation directory of the new SQL Server database data file (.mdf).
MSSQL_LOG_DIR
Change the creation directory of the new SQL Server database log file (.ldf).
MSSQL_DUMP_DIR
Change the default directory where SQL Server stores memory dumps and other troubleshooting files.
MSSQL_ENABLE_HADR
Enable availability groups. For example, "1" is enabled and "0" is disabled
MSSQL_AGENT_ENABLED
Enable the SQL Server agent. For example, "true" is enabled and "false" is disabled. By default, the agent is disabled.
MSSQL_MASTER_DATA_FILE
Set the location of the primary database data file. Before you run SQL Server for the first time, you must name it master.mdf.
MSSQL_MASTER_LOG_FILE
Set the location of the primary database log file. Before you run SQL Server for the first time, you must name it mastlog.ldf.
MSSQL_ERROR_LOG_FILE
Set the location of the error log file.

Start a SQL Server 2019 application

First, to prevent container data loss, we need to map the database file directory in the container to a directory on the host machine. The command is as follows:

Remark:Be sure to set the users and groups to which the directory belongs, will the error be as follows:

SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
To learn more visitThe hyperlink login is visible.
/opt/mssql/bin/sqlservr: Error: The system directory [/.system] could not be created. File: LinuxDirectory.cpp:420 [Status: 0xC0000022 Access Denied errno = 0xD(13) Permission denied]

Configure some startup parameters according to the environment variables to start an application with the following command:

SQL Server 2019 key (For learning testing only, do not use in production environments

Enterprise:HMWJ3-KY3J2-NMVD7-KG4JR-X2G8G
Strandard:PMBDC-FXVM3-T777P-N4FY8-PKFF4

The password should conform to the SQL Server default password policy, otherwise the container will stop working if it fails to set up SQL Server. By default,The password must be at least 8 characters long and must contain one of the following four charactersThree: Uppercase letters, lowercase letters, decimal numbers, and symbols.

The host can mount on the found container/var/opt/mssqldirectory, and other files such as SQL Server system binaries are not supported.

After the container starts, check the logs as shown in the following image:



Go inside the container, as shown below:



Connect to a SQL Server 2019 database

Download SQL Server Management Studio (SSMS):The hyperlink login is visible.

Open the SSMS tool, enter the address, account number, and password to test a new database, as shown in the figure below:




Resources:

The hyperlink login is visible.
The hyperlink login is visible.
The hyperlink login is visible.





Previous:Spring Boot is based on AD domain (LDAP) authentication
Next:Java InputStream replicate clones, solving the problem of multiple reads
 Landlord| Posted on 9/7/2024 9:16:42 PM |
Docker installs sql server 2022 version

Create a new directory and set up affiliated users

docker-compose.yml Configuration

Summary of SQL Server 2008~2022 version serial numbers/keys/activation codes
https://www.itsvse.com/thread-10828-1-1.html

 Landlord| Posted on 6/6/2025 9:12:14 AM |
Title: Microsoft SQL Server Management Studio
------------------------------

Server "xxx" for Attached Database fails.  (Microsoft.SqlServer.Smo)

For help information, click:https://go.microsoft.com/fwlink? ... tionText&EvtID=Attach Database +Server & LinkId=20476

------------------------------
Additional information:

An exception occurred when executing a Transact-SQL statement or batch processing. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Database 'itsvseDb' cannot be upgraded because it is read-only, has read-only files or the user does not have permissions to modify some of the files. Make the database or files writeable, and rerun recovery. (Microsoft SQL Server, Error: 3415)

For help information, click:https://docs.microsoft.com/sql/r ... tabase-engine-error

------------------------------
Button:

Are you sure
------------------------------
If the above problems occur, it is generally a file permission problem, usechownJust modify it.
 Landlord| Posted on 11/27/2022 7:08:17 PM |
Update docker commands:

Posted on 12/4/2021 5:03:57 PM |
Come and learn again
Posted on 12/12/2021 12:40:23 AM |
Speedy IP Open Port Scanner v2.0 [Source Code
 Landlord| Posted on 12/28/2021 9:22:46 PM |
docker mssql sets the time zone

Enter the container and enter the TZSELECT command, as shown in the following figure:



Or add environment variables to set the time zone when starting the container, taking Shanghai, China as an example:


Reference:The hyperlink login is visible.
 Landlord| Posted on 12/28/2021 9:45:06 PM |
docker command:

Posted on 8/30/2022 11:14:04 AM |

Come and learn again
Posted on 3/1/2023 4:24:10 PM |
Learn from it, thanks for sharing
Posted on 5/15/2023 8:53:46 AM |
Very nice post, useful.
 Landlord| Posted on 9/4/2024 9:18:30 AM |
Docker Hardware Requirements:The hyperlink login is visible.
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com