Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker-base]: Enabled common debug packages installation. #292

Merged
merged 2 commits into from
Feb 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ dockers/docker-snmp-sv2/Dockerfile
dockers/docker-team/Dockerfile
dockers/docker-teamd/Dockerfile
dockers/docker-config-engine/Dockerfile
dockers/docker-base/Dockerfile
platform/broadcom/docker-syncd-brcm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,16 @@ RUN apt-get -y purge \
exim4-config \
exim4-daemon-light

{% if docker_base_dbgs %}
## Install common debug-packages
RUN apt-get -y install \
{% for dbg_pkg in docker_base_dbgs.split(' ') -%}
{{ dbg_pkg }}{{' '}}
{%- endfor %}
{% endif %}

## Clean up apt
## Remove /var/lib/apt/lists/*, could be obsoleted for derived images
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y; \
rm -rf /var/lib/apt/lists/*; \
rm -rf /tmp/*;

3 changes: 3 additions & 0 deletions rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ PASSWORD = YourPaSsWoRd
# If not set (default behavior) the default minigraph built into the image will be used.
# ENABLE_DHCP_GRAPH_SERVICE = y

# SONIC_CONFIG_DEBUG - install debug packages
# Uncomment next line to enable:
# SONIC_CONFIG_DEBUG = y
10 changes: 9 additions & 1 deletion rules/docker-base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@
DOCKER_BASE = docker-base.gz
$(DOCKER_BASE)_PATH = $(DOCKERS_PATH)/docker-base

SONIC_SIMPLE_DOCKER_IMAGES += $(DOCKER_BASE)
ifeq ($(SONIC_CONFIG_DEBUG),y)
GDB = gdb
VIM = vim
OPENSSH = openssh-client
SSHPASS = sshpass
$(DOCKER_BASE)_DBG_PACKAGES += $(GDB) $(VIM) $(OPENSSH) $(SSHPASS)
endif

SONIC_DOCKER_IMAGES += $(DOCKER_BASE)
1 change: 1 addition & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .pl
sudo mount --bind $(PYTHON_WHEELS_PATH) $($*.gz_PATH)/python-wheels $(LOG)
# Export variables for j2. Use path for unique variable names, e.g. docker_orchagent_debs
$(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++'))
$(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_PACKAGES)))\n" | awk '!a[$$0]++'))
j2 $($*.gz_PATH)/Dockerfile.j2 > $($*.gz_PATH)/Dockerfile
docker build --squash --no-cache -t $* $($*.gz_PATH) $(LOG)
docker save $* | gzip -c > $@
Expand Down