英文:
Docker (Ubuntu)+SQL Server 2022+FTS?
问题
我正在运行 Docker(Ubuntu)+ SQL Server 2022,使用 docker-compose 文件。
version: "3.4"
services:
sql-server-db:
image: "mcr.microsoft.com/mssql/server:2022-latest"
ports:
- "52477:1433"
environment:
SA_PASSWORD: "dobedo#123"
ACCEPT_EULA: "Y"
它运行正常,但是
SELECT FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')
---
0
如何在 Docker 中运行 SQL Server 2022 + FTS?
我已经创建了两个文件 docker-compose.yml
和 Dockerfile.new
(如下所述)。运行 docker-compose up -d
后,我收到以下消息:
PS D:\_Docker\SQLServer> docker-compose up -d
Building 1.1s (6/7)
[sql-server-db internal] load build definition from Dockerfile.new 0.0s
transferring dockerfile: 736B 0.0s
[sql-server-db internal] load .dockerignore 0.0s
transferring context: 2B 0.0s
[sql-server-db internal] load metadata for mcr.microsoft.com/mssql/server:2022-latest 0.0s
[sql-server-db 1/4] FROM mcr.microsoft.com/mssql/server:2022-latest 0.0s
CACHED [sql-server-db 2/4] RUN apt-get update && apt-get install -yq curl apt-transport-https 0.0s
ERROR [sql-server-db 3/4] RUN apt-get install -y mssql-server-fts 1.1s
------
> [sql-server-db 3/4] RUN apt-get install -y mssql-server-fts:
#0 0.278 Reading package lists...
#0 0.927 Building dependency tree...
#0 1.073 Reading state information...
**#0 1.090 E: Unable to locate package mssql-server-fts**
我的 Dockerfile.new
:
FROM mcr.microsoft.com/mssql/server:2022-latest
USER root
RUN apt-get update && apt-get install -yq curl apt-transport-https
#RUN add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2022.list)"
RUN apt-get install -y mssql-server-fts
RUN apt-get update && \
apt-get install -yq curl apt-transport-https && \
# Get official Microsoft repository configuration
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2022.list | tee /etc/apt/sources.list.d/mssql-server.list && \
apt-get update && \
apt-get install -y mssql-server-fts
英文:
I am running Docker (Ubuntu)+SQL Server 2022 using docker-compose file
-----
version: "3.4"
services:
sql-server-db:
image: "mcr.microsoft.com/mssql/server:2022-latest"
ports:
- "52477:1433"
environment:
SA_PASSWORD: "dobedo#123"
ACCEPT_EULA: "Y"
-----
It works fine, but
SELECT FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')
---
0
How to run Docker with SQLServer2022 + FTS ?
I have created 2 files docker-compose.yml and Dockerfile.new (as it was described below). After run the >docker-compose up -d I have recived
PS D:\_Docker\SQLServer> docker-compose up -d
Building 1.1s (6/7)
[sql-server-db internal] load build definition from Dockerfile.new 0.0s
transferring dockerfile: 736B 0.0s
[sql-server-db internal] load .dockerignore 0.0s
transferring context: 2B 0.0s
[sql-server-db internal] load metadata for mcr.microsoft.com/mssql/server:2022-latest 0.0s
[sql-server-db 1/4] FROM mcr.microsoft.com/mssql/server:2022-latest 0.0s
CACHED [sql-server-db 2/4] RUN apt-get update && apt-get install -yq curl apt-transport-https 0.0s
ERROR [sql-server-db 3/4] RUN apt-get install -y mssql-server-fts 1.1s
------
> [sql-server-db 3/4] RUN apt-get install -y mssql-server-fts:
#0 0.278 Reading package lists...
#0 0.927 Building dependency tree...
#0 1.073 Reading state information...
**#0 1.090 E: Unable to locate package mssql-server-fts**
My Dockerfile.new:
FROM mcr.microsoft.com/mssql/server:2022-latest
USER root
RUN apt-get update && apt-get install -yq curl apt-transport-https
#RUN add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2022.list)"
RUN apt-get install -y mssql-server-fts
RUN apt-get update && \
apt-get install -yq curl apt-transport-https && \
# Get official Microsoft repository configuration
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2022.list | tee /etc/apt/sources.list.d/mssql-server.list && \
apt-get update && \
apt-get install -y mssql-server-fts
答案1
得分: 1
你应该添加包 apt install -y mssql-server-fts
。
所以,在你的情况下,创建一个类似这样的 Dockerfile:
FROM mcr.microsoft.com/mssql/server:2022-latest
USER root
RUN apt update && apt install -y mssql-server-fts
并相应地修改 docker-compose 文件:
services:
sql-server-db:
build:
context: .
dockerfile: Dockerfile
...
英文:
You should add the package apt install -y mssql-server-fts
.
So, in your case, create a Dockerfile like this:
FROM mcr.microsoft.com/mssql/server:2022-latest
USER root
RUN apt update && apt install -y mssql-server-fts
and modify the docker-compose file accordingly:
services:
sql-server-db:
build:
context: .
dockerfile: Dockerfile
...
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论