You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then the hostname environment variable is not recognized. I get the following message:
The HOSTNAME variable is not set. Defaulting to a blank string.
If I execute the same command on the host "bar" with the user "foo" I don't get the error. Same if I first connect with ssh, and then execute the command.
This is a major issue for us. This workflow happens in our CI.
The only workaround we found is to write the following script:
#!/bin/bash export HOSTNAME=${HOSTNAME} docker-compose up -d
And execute it through ssh.. Which is not handsome..
The text was updated successfully, but these errors were encountered:
Well, doesn't that happen because when executing the command through ssh directly, you're not actually opening a shell? Meaning that some environment variables like $HOSTNAME will not be set?
Looks like your issue is with UNIX and/or SSH - I don't see anything that can be done about this at the Compose level.
That's what I was thinking. But the following command workaround works.. Which means that the variable HOSTNAME is correctly set during the ssh session. So I don't know why compose do not recognize it... That's weird.
Hello,
Given docker-compose 1.9.0 and the following docker-compose.yml:
version: '2'
services:
kafka:
image: wurstmeister/kafka
environment:
KAFKA_ADVERTISED_HOST_NAME: ${HOSTNAME}
When I execute the following command:
ssh foo@bar.mydomain.com "docker-compose up -d
Then the hostname environment variable is not recognized. I get the following message:
If I execute the same command on the host "bar" with the user "foo" I don't get the error. Same if I first connect with ssh, and then execute the command.
This is a major issue for us. This workflow happens in our CI.
The only workaround we found is to write the following script:
#!/bin/bash
export HOSTNAME=${HOSTNAME}
docker-compose up -d
And execute it through ssh.. Which is not handsome..
The text was updated successfully, but these errors were encountered: