From b26ec863e84f758fa82e0548ef1cfa78e8aa886a Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Thu, 11 May 2017 18:46:11 -0700 Subject: [PATCH] [docker-base]: Add less, strace, and configuration for vim (#591) * Add less in docker-base. Add strace in docker_base_dbg. * Make link vim to vim.tiny and have vim config file --- build_debian.sh | 1 + dockers/docker-base/Dockerfile.j2 | 6 +++++- dockers/docker-base/root/.vimrc | 2 ++ rules/docker-base.mk | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 dockers/docker-base/root/.vimrc diff --git a/build_debian.sh b/build_debian.sh index 009cf3bf4b..d713ca0e52 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -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 diff --git a/dockers/docker-base/Dockerfile.j2 b/dockers/docker-base/Dockerfile.j2 index b014c20a64..d02d3c5450 100644 --- a/dockers/docker-base/Dockerfile.j2 +++ b/dockers/docker-base/Dockerfile.j2 @@ -27,10 +27,12 @@ RUN apt-get -y install \ supervisor \ vim-tiny \ 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 \ @@ -44,6 +46,8 @@ RUN apt-get -y install \ {% for dbg_pkg in docker_base_dbgs.split(' ') -%} {{ dbg_pkg }}{{' '}} {%- endfor %} +{% else %} +RUN ln /usr/bin/vim.tiny /usr/bin/vim {% endif %} ## Clean up apt diff --git a/dockers/docker-base/root/.vimrc b/dockers/docker-base/root/.vimrc new file mode 100644 index 0000000000..5c1ba8a04f --- /dev/null +++ b/dockers/docker-base/root/.vimrc @@ -0,0 +1,2 @@ +" enable vim features +set nocompatible diff --git a/rules/docker-base.mk b/rules/docker-base.mk index f041f7d05c..1580c357cd 100644 --- a/rules/docker-base.mk +++ b/rules/docker-base.mk @@ -8,7 +8,8 @@ GDB = gdb VIM = vim OPENSSH = openssh-client SSHPASS = sshpass -$(DOCKER_BASE)_DBG_PACKAGES += $(GDB) $(VIM) $(OPENSSH) $(SSHPASS) +STRACE = strace +$(DOCKER_BASE)_DBG_PACKAGES += $(GDB) $(VIM) $(OPENSSH) $(SSHPASS) $(STRACE) endif SONIC_DOCKER_IMAGES += $(DOCKER_BASE)