Skip to content

Commit

Permalink
[docker]: get hostname from config db instead of minigraph (#3004)
Browse files Browse the repository at this point in the history
minigraph may not be always available on the some system configuration.
Should use config db as the source of truth.
  • Loading branch information
lguohan authored Jun 14, 2019
1 parent 383fc0f commit 8f6ae90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ start() {
{%- else %}
# Obtain our HWSKU as we will mount directories with these names in each docker
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'`
HOSTNAME=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hostname"]'`
{%- endif %}
HOSTNAME=`sonic-cfggen -m -v 'DEVICE_METADATA["localhost"]["hostname"]'`
if [ -z "$HOSTNAME" ] || ! [[ $HOSTNAME =~ ^[a-zA-Z0-9.\-]*$ ]]; then
HOSTNAME=`hostname`
fi
Expand Down

0 comments on commit 8f6ae90

Please sign in to comment.