1

Why is it that when checking the container test.cnf is a directory instead of a file based on the templete stanza, can you check it please

  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"
  }
rkevx21
  • 2,441
  • 5
  • 19
  • 40
  • According to the documentation, it appears Nomad only supports directory bind volume mounting for the Docker driver: https://nomadproject.io/docs/drivers/docker/#inlinecode-volumes-4 – Matthew Schuchard Feb 24 '20 at 14:41

1 Answers1

1

There solution is to use mounts instead of volumes. https://www.nomadproject.io/docs/drivers/docker/#mounts

This is an excerpt from Docker documentation. Nomad has to follow that specification to work with 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).

Since bind mount type allows you to bind files from host to container I suggest you use the bind example from the documentation.

vkozyrev
  • 1,770
  • 13
  • 13