Define CONTAINER_NAME based on name of host machine

Hi everyone. I’m using terraform and rancher to deploy cbuisson/chef-server image. The process of configuring nginx inside this container, especially creating certificates, is based on the container name. When the container is deployed, I’m able to access chef-server via physical machine’s IP, or its FQDN. The problem is I could not find any functionality to provide this CONTAINER_NAME variable based on which host Rancher decides to put my chef-server container on. I’m running several physical
machines, so CONTAINER_NAME has to be generated on-the-go. I found, but when I insert it into my docker-compose, it fails with a mistake, that it should be a string. Has anyone met this issue?

1 Like

Which rancher/server are you using?

I’m using 1.6.6 version