Skip to content

Commit

Permalink
Map /src & /debug for debug docker containers (#3470)
Browse files Browse the repository at this point in the history
* Add debug docker for SNMP.

* Removed a redundant install of debug packages.
Propagate the debug flag to template file to mount /dbg & /src to debug containers.

* Revert the last change to retain the original
  • Loading branch information
renukamanavalan authored Sep 19, 2019
1 parent e9037a7 commit 0493b62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ start() {
# TODO: Mellanox will remove the --tmpfs exception after SDK socket path changed in new SDK version
{%- endif %}
docker create {{docker_image_run_opt}} \
{%- if install_debug_image == "y" %}
-v /src:/src:ro -v /debug:/debug:rw \
{%- endif %}
{%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %}
--log-opt max-size=2M --log-opt max-file=5 \
{%- endif %}
Expand Down
1 change: 1 addition & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
export swsssdk_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SWSSSDK_PY2))"
export platform_common_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_COMMON_PY2))"
export redis_dump_load_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(REDIS_DUMP_LOAD_PY2))"
export install_debug_image="$(INSTALL_DEBUG_TOOLS)"

$(foreach docker, $($*_DOCKERS),\
export docker_image="$(docker)"
Expand Down

0 comments on commit 0493b62

Please sign in to comment.