diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index a828dfb4c2..aab3789332 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -134,6 +134,9 @@ start() { echo "Creating new {{docker_container_name}} container" {%- else %} echo "Creating new {{docker_container_name}} container with HWSKU $HWSKU" +{%- endif %} +{%- if sonic_asic_platform == "mellanox" %} + # TODO: Mellanox will remove the --tmpfs exception after SDK socket path changed in new SDK version {%- endif %} docker create {{docker_image_run_opt}} \ {%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %} @@ -146,6 +149,10 @@ start() { -e PRM_SNIFFER \ -e PRM_SNIFFER_FILE_PATH \ -v /var/log/mellanox/sniffer:/var/log/mellanox/sniffer:rw \ + -v mlnx_sdk_socket:/tmp \ + -v /dev/shm:/dev/shm:rw \ +{%- else %} + --tmpfs /tmp \ {%- endif %} {%- if docker_container_name == "pmon" %} -v /var/run/hw-management:/var/run/hw-management:rw \ @@ -156,7 +163,9 @@ start() { {%- if docker_container_name != "database" %} -v /usr/share/sonic/device/$PLATFORM/$HWSKU:/usr/share/sonic/hwsku:ro \ {%- endif %} +{%- if sonic_asic_platform != "mellanox" %} --tmpfs /tmp \ +{%- endif %} --tmpfs /var/tmp \ --name={{docker_container_name}} {{docker_image_name}}:latest || { echo "Failed to docker run" >&1