简体   繁体   English

如何使用 docker 作曲家为 reavenDB 添加服务器许可证

[英]How to add the server license for reavenDB with docker composer

Some how it's not clear how to add the server license for ravenDB in a docker compose file.有些不清楚如何在 docker 撰写文件中添加 ravenDB 的服务器许可证。

Docker compose Docker 撰写

version: "3.9"
services:
  raven1:
    container_name: raven1
    image: ravendb/ravendb
    ports:
      - 8091:8080
      - 38888:38888
    environment:
      - RAVEN_Setup_Mode=None
      - RAVEN_License_Eula_Accepted=true
      - RAVEN_Security_UnsecuredAccessAllowed=PrivateNetwork
      - RAVEN_License_Path=/Users/********/projects/RavenDB/license.json
    volumes:
      - /Users/********/projects/RavenDB/Data:/opt/RavenDB/Server/RavenData

license.json许可证.json

{
    "Id": "da9446f7-ad2e-4267-ae62-47ff2f34bc86",
    "Name": "Swisscom",
    "Keys": [
        ...
    ]
}

The license is not added.未添加许可证。 What is the correct way to add this server license.添加此服务器许可证的正确方法是什么。

在此处输入图像描述

the variable RAVEN_License_Path shows the license path inside the docker. So it should be变量 RAVEN_License_Path 显示 docker 内的许可证路径。所以它应该是

RAVEN_License_Path=/opt/RavenDB/Server/RavenLicense/license.json

and add this volume并添加此卷

- /Users/********/projects/RavenLicense:/opt/RavenDB/Server/RavenLicense

Your RAVEN_License_Path looks like it is pointing to a path on your host machine, and therefore it can't be found from within the container.您的RAVEN_License_Path看起来像是指向主机上的路径,因此无法从容器中找到它。

Ie it's just an environment variable containing an arbitrary path and the server running within the container will try to resolve this path.也就是说,它只是一个包含任意路径的环境变量,在容器内运行的服务器将尝试解析该路径。 But of course it can't because it's a path from an entirely unrelated file system.但当然不能,因为它是来自完全不相关的文件系统的路径。

So you have two possibilities所以你有两种可能

  1. You create a new image based on ravendb/ravendb where you add your licensefile您创建一个基于ravendb/ravendb的新图像,在其中添加您的许可文件
  2. You put your licensefile into a folder that is mounted into the container (similar to your data volume) IMO this is the preferred solution.您将许可文件放入安装到容器中的文件夹中(类似于您的数据量)IMO 这是首选解决方案。

In both cases, you need to change your RAVEN_Licence_Path to be a valid path within the running container.在这两种情况下,您都需要将RAVEN_Licence_Path更改为正在运行的容器中的有效路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM