小编Mat*_*Mat的帖子

Docker:使用 docker-compose 复制文件和目录

我为自定义应用程序创建了一个 Docker 映像,该应用程序需要一些许可证文件(一些文件和一个目录)才能运行,因此我使用 COPY 命令Dockerfile将许可证文件复制到映像:

# Base image: Application installed on Debian 10 but unlicensed
FROM me/application-unlicensed

# Copy license files
COPY *.license /opt/application/
COPY application-license-dir /var/lib/application-license-dir
Run Code Online (Sandbox Code Playgroud)

我使用它Dockerfile来构建一个具有单个容器许可证的新映像。因为我有 5 个不同的许可证,所以我创建了 5 个不同的图像,每个图像都有一个特定的许可证文件和目录。

许可证也固定到MAC 地址,因此当我运行五个容器之一时,我使用--mac-address参数指定自己的 MAC 地址:

docker run --rm --mac-address AB:CD:EF:12:34:56 me/application-license1
Run Code Online (Sandbox Code Playgroud)

这项工作,但我希望有一个更好更聪明的方法来管理这个:

docker-compose是否可以指定容器 MAC 地址一样,当我使用docker-compose.


编辑:让我更好地解释许可证文件的结构

应用程序部署到/opt/applicationDocker 镜像的目录中。

许可证文件 ( *.license)/opt/application位于应用程序本身的同一级别,除非我创建一些符号链接,否则它们无法保存到 Docker 卷中(但我必须检查应用程序是否能以这种方式工作)。

目录 application-license-dir 需要在/var/lib/application-license-dir,因此它可以安装到 Docker 卷中(我必须检查应用程序是否可以工作,但我认为可以)。

这两个*.license …

docker docker-compose

8
推荐指数
1
解决办法
7280
查看次数

计算SOLR索引中单词的总频率

如果我在SOLR索引中搜索某个单词,则会得到包含该单词的文档的文档计数,但是如果该单词在文档中包含的次数更多,则每个文档的总数仍为1。

我需要对每个返回的文档进行计数,以计算它们在该字段中具有搜索词的次数。

在SolrSOLR术语频率中读取词频率,并启用了术语向量分量,但是它不起作用。

我以这种方式配置字段:

<field name="text_text" type="textgen" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true" />
Run Code Online (Sandbox Code Playgroud)

但是,如果我进行以下查询:

http://localhost:8888/solr/sources/select?q=text_text%3A%22Peter+Pan%22&fl=text_text&wt=json&indent=true&tv.tf
Run Code Online (Sandbox Code Playgroud)

我没有任何数:

{
  "responseHeader":{
    "status":0,
    "QTime":1,
    "params":{
      "fl":"text_text",
      "tv.tf":"",
      "indent":"true",
      "q":"text_text:\"Peter Pan\"",
      "wt":"json"}},
  "response":{"numFound":12,"start":0,"docs":[
      {
        "text_text":"Text of the document"},
      {
        "text_text":"Text of the document"},
      {
        "text_text":"Text of the document"},
      {
        "text_text":"Text of the document"},
      {
        "text_text":"Text of the document"},
      {
        "text_text":"Text of the document"},
      {
        "text_text":"Text of the document"},
      {
        "text_text":"Text of the document"}]
  }}
Run Code Online (Sandbox Code Playgroud)

我看到“ numFound”值为12,但在所有12个文档中都包含20次“ Peter Pan”。

你能帮我找到我错了吗? …

solr word-frequency

6
推荐指数
1
解决办法
3839
查看次数

标签 统计

docker ×1

docker-compose ×1

solr ×1

word-frequency ×1