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]: Add less into docker-base. Add strace in docker_base_dbg. Add configuration for vim #591

Merged
merged 2 commits into from
May 12, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
logrotate \
curl \
kexec-tools \
less \
unzip

## Disable kexec supported reboot which was installed by default
Expand Down
6 changes: 4 additions & 2 deletions dockers/docker-base/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ RUN apt-get clean && apt-get update
RUN apt-get -y install \
rsyslog \
supervisor \
vim-tiny \
vim \
Copy link
Collaborator

@qiluo-msft qiluo-msft May 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.5M400k vs 28M, do you have some strong requirement for a complete vim?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are installing N 200MB dockers anyway :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the help of layer reuse and docker squash (https://docs.docker.com/engine/reference/commandline/build/), the total disk size of the docker images and containers in a production switches is about 570M. Currently we are still deploying images for small disk switches.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it 2M or 28M?

Copy link
Collaborator

@qiluo-msft qiluo-msft May 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The largest component for vim is vim-runtime 25.5M: https://packages.debian.org/jessie/vim-runtime. The total size of vim packages is ~28M.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given the smallest disk we have to deal with is still 1.5GB, i recommend to keep vim in the debug build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep vim.tiny for docker-base. But put .vimrc and make link from vim.tiny to vim.

perl \
python
python \
less

COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"]
COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"]
COPY ["root/.vimrc", "/root/.vimrc"]

RUN apt-get -y purge \
exim4 \
Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-base/root/.vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
" enable vim features
set nocompatible
4 changes: 2 additions & 2 deletions rules/docker-base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ $(DOCKER_BASE)_PATH = $(DOCKERS_PATH)/docker-base

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

SONIC_DOCKER_IMAGES += $(DOCKER_BASE)