Skip to content

Commit 8f6ae90

Browse files
authored
[docker]: get hostname from config db instead of minigraph (#3004)
minigraph may not be always available on the some system configuration. Should use config db as the source of truth.
1 parent 383fc0f commit 8f6ae90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

files/build_templates/docker_image_ctl.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ start() {
130130
{%- else %}
131131
# Obtain our HWSKU as we will mount directories with these names in each docker
132132
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'`
133+
HOSTNAME=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hostname"]'`
133134
{%- endif %}
134-
HOSTNAME=`sonic-cfggen -m -v 'DEVICE_METADATA["localhost"]["hostname"]'`
135135
if [ -z "$HOSTNAME" ] || ! [[ $HOSTNAME =~ ^[a-zA-Z0-9.\-]*$ ]]; then
136136
HOSTNAME=`hostname`
137137
fi

0 commit comments

Comments
 (0)