Requirements: Tested the full-text search function of SQL SERVER and found that SQL SERVER 2022 installed based on Docker does not have the full-text search service installed by default, so manual installation is required.
To check if FTS is installed, do the following:
If you find that there is no installation, create a new Dockerfile file to rebuild an image, which reads:
Parameter description:
USER root The first step in a Dockerfile is to set up the user. This usually overrides the users set in the parent image. In this example, the user is set to root. This is important for the installation of the mssql-server-fts package and granting write permissions in the apt source directory. RUN apt-get update Once the user is set up, run apt-get update to update the package index and ensure that you have the latest package version. RUN apt-get install -yq curl apt-transport-https gnupg This step installs curl, apt-transport-https, and gnupg packages. These are the packages required to communicate with the Microsoft repository. RUN curlhttps://packages.microsoft.com/keys/microsoft.asc| apt-key add - && curlhttps://packages.microsoft.com/c ... ql-server-2022.list| tee /etc/apt/sources.list.d/mssql-server-2022.list In this step, we will download and install the Microsoft repository key, which is important for the next step. We will also create the file mssql-server-2022.list and copy it into the /etc/apt/sources.list.d/ directory. This is done to enable package installation from the Microsoft repository. RUN apt-get update After adding the Microsoft repository, run apt-get update again to update the package index using the Microsoft repository. RUN apt-get install -y mssql-server-fts This step installs the full-text search feature to install the required mssql-server-fts package. RUN apt-get clean && rm -rf /var/lib/apt/lists/* This step cleans up all unnecessary packages to free up disk space. It removes all unused packages. This is an important step in keeping your Docker image size small. USER mssql After cleaning up unused packages, we switch the user to mssql. This is the user used to execute the SQL Server process. It is important to ensure that the user is not root to avoid any security issues. EXPOSE 1433 This step exposes port 1433, which is the default SQL Server port. This is important to allow access from other containers and hosts. CMD ["/opt/mssql/bin/sqlservr"] This step sets the default command for the container to start the SQL Server process. If we want to start the container to run other processes, we have to set it up here using the CMD command.
Run the command to build the new image, as follows:
As shown below:
Based on the new image, start a docker container, as shown below:
(End)
|