【问题标题】:Nomad Template : Folder is created instead of fileNomad 模板:创建文件夹而不是文件
【发布时间】:2020-06-07 18:15:54
【问题描述】:

为什么在检查容器时test.cnf是目录而不是基于templete节的文件,请检查一下

  config {
    image = "percona/percona-xtradb-cluster:5.7"
    volumes = ["/tmp/new.conf:/etc/mysql/test.conf"]

    port_map {
      db = 3306
      gc = 4567
      ss = 4444
      ist = 4568
    }
  }

  template {
    data = <<EOH
      binlog_format=ROW
      default_storage_engine=InnoDB
      !include /etc/mysql/node.cnf
    EOH
    destination   = "/tmp/new.conf"
  }

【问题讨论】:

标签: ubuntu nomad percona-xtradb-cluster


【解决方案1】:

解决方案是使用mounts 而不是volumeshttps://www.nomadproject.io/docs/drivers/docker/#mounts

这是 Docker 文档的摘录。 Nomad 必须遵循该规范才能使用 Docker。

挂载类型,可以是卷、绑定、tmpfs 或 npipe。
如果未指定类型,则默认为卷。
volume:将托管卷挂载到容器中。
bind:将目录或文件从主机绑定挂载到容器中。
@987654327 @:在容器中挂载一个 tmpfs。
npipe:将命名管道从主机挂载到容器中(仅限 Windows 容器)。

由于bind 挂载类型允许您将文件从主机绑定到容器,我建议您使用use the bind example from the documentation

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-07
    • 2014-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多