gpt4 book ai didi

ubuntu - 游牧模板 : Folder is created instead of file

转载 作者:行者123 更新时间:2023-12-04 18:44:18 28 4
gpt4 key购买 nike

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

  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"
}

最佳答案

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

这是 Docker 文档的摘录。 Nomad 必须遵循该规范才能与 Docker 一起工作。

The type of mount, can be either volume, bind, tmpfs, or npipe.
Defaults to volume if no type is specified.
volume: mounts a managed volume into the container.
bind: bind-mounts a directory or file from the host into the container.
tmpfs: mount a tmpfs in the container.
npipe: mounts named pipe from the host into the container (Windows containers only).



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

关于ubuntu - 游牧模板 : Folder is created instead of file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60370460/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com