From d9d43595036323c41ec71e2ab02f51f183017a48 Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Thu, 5 Mar 2020 10:56:39 +0530 Subject: [PATCH 1/9] Some debian package manager tweaks By default, Ubuntu or Debian based "apt" or "apt-get" system installs recommended but not suggested packages . By passing "--no-install-recommends" option, the user lets apt-get know not to consider recommended packages as a dependency to install. This results in smaller downloads and installation of packages . Refer to blog at [Ubuntu Blog](https://ubuntu.com/blog/we-reduced-our-docker-images-by-60-with-no-install-recommends) . results in smaller image size. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 57a9bc74c8d9..c1e466d41f49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,12 +21,12 @@ ENV DJANGO_CONFIGURATION=${DJANGO_CONFIGURATION} # Install necessary apt packages RUN apt-get update && \ - apt-get install -yq \ + apt-get --no-install-recommends install -yq \ software-properties-common && \ add-apt-repository ppa:mc3man/xerus-media -y && \ add-apt-repository ppa:mc3man/gstffmpeg-keep -y && \ apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -yq \ + DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends install -yq \ apache2 \ apache2-dev \ libapache2-mod-xsendfile \ @@ -44,7 +44,7 @@ RUN apt-get update && \ poppler-utils \ curl && \ curl https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ - apt-get install -y git-lfs && git lfs install && \ + apt-get --no-install-recommends install -y git-lfs && git lfs install && \ if [ -z ${socks_proxy} ]; then \ echo export "GIT_SSH_COMMAND=\"ssh -o StrictHostKeyChecking=no -o ConnectTimeout=30\"" >> ${HOME}/.bashrc; \ else \ From 4a4f7d81597968fbbadc862d7071cb1934e3342d Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Thu, 5 Mar 2020 10:57:21 +0530 Subject: [PATCH 2/9] Some debian package manager tweaks By default, Ubuntu or Debian based "apt" or "apt-get" system installs recommended but not suggested packages . By passing "--no-install-recommends" option, the user lets apt-get know not to consider recommended packages as a dependency to install. This results in smaller downloads and installation of packages . Refer to blog at [Ubuntu Blog](https://ubuntu.com/blog/we-reduced-our-docker-images-by-60-with-no-install-recommends) . results in smaller image size. --- Dockerfile.ci | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.ci b/Dockerfile.ci index e3671196ee38..cc3d8f98f12f 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -7,7 +7,7 @@ RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - & echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list && \ curl https://deb.nodesource.com/setup_9.x | bash - && \ apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -yq \ + DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends install -yq \ google-chrome-stable \ nodejs && \ rm -rf /var/lib/apt/lists/*; @@ -29,4 +29,4 @@ RUN mkdir -p tests && cd tests && npm install \ qunit; \ echo "export PATH=~/tests/node_modules/.bin:${PATH}" >> ~/.bashrc; -ENTRYPOINT [] \ No newline at end of file +ENTRYPOINT [] From 0caa402359ca449658e5c14b590b5e2918f41bb6 Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Thu, 5 Mar 2020 10:59:50 +0530 Subject: [PATCH 3/9] Some debian package manager tweaks By default, Ubuntu or Debian based "apt" or "apt-get" system installs recommended but not suggested packages . By passing "--no-install-recommends" option, the user lets apt-get know not to consider recommended packages as a dependency to install. This results in smaller downloads and installation of packages . Refer to blog at [Ubuntu Blog](https://ubuntu.com/blog/we-reduced-our-docker-images-by-60-with-no-install-recommends) . --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a0ff41aca79f..8cb2d4834297 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,7 +15,7 @@ Next steps should work on clear Ubuntu 18.04. - Install necessary dependencies: ```sh -$ sudo apt update && apt install -y nodejs npm curl redis-server python3-dev python3-pip python3-venv libldap2-dev libsasl2-dev +$ sudo apt-get update && apt-get --no-install-recommends install -y nodejs npm curl redis-server python3-dev python3-pip python3-venv libldap2-dev libsasl2-dev ``` - Install [Visual Studio Code](https://code.visualstudio.com/docs/setup/linux#_debian-and-ubuntu-based-distributions) From 046690614f3f65e413a0aad468296082ef0a916b Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Thu, 5 Mar 2020 11:05:03 +0530 Subject: [PATCH 4/9] Some debian package manager tweaks By default, Ubuntu or Debian based "apt" or "apt-get" system installs recommended but not suggested packages . By passing "--no-install-recommends" option, the user lets apt-get know not to consider recommended packages as a dependency to install. This results in smaller downloads and installation of packages . Refer to blog at [Ubuntu Blog](https://ubuntu.com/blog/we-reduced-our-docker-images-by-60-with-no-install-recommends) . --- cvat/apps/documentation/installation.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cvat/apps/documentation/installation.md b/cvat/apps/documentation/installation.md index 1286fe813c2e..24f96afc1eb0 100644 --- a/cvat/apps/documentation/installation.md +++ b/cvat/apps/documentation/installation.md @@ -27,7 +27,7 @@ server. Proxy is an advanced topic and it is not covered by the guide. ```sh sudo apt-get update - sudo apt-get install -y \ + sudo apt-get --no-install-recommends install -y \ apt-transport-https \ ca-certificates \ curl \ @@ -39,7 +39,7 @@ server. Proxy is an advanced topic and it is not covered by the guide. $(lsb_release -cs) \ stable" sudo apt-get update - sudo apt-get install -y docker-ce docker-ce-cli containerd.io + sudo apt-get --no-install-recommends install -y docker-ce docker-ce-cli containerd.io ``` - Perform [post-installation steps](https://docs.docker.com/install/linux/linux-postinstall/) @@ -57,7 +57,7 @@ server. Proxy is an advanced topic and it is not covered by the guide. defining and running multi-container docker applications. ```bash - sudo apt-get install -y python3-pip + sudo apt-get --no-install-recommends install -y python3-pip sudo python3 -m pip install docker-compose ``` @@ -65,7 +65,7 @@ server. Proxy is an advanced topic and it is not covered by the guide. [GitHub repository](https://github.com/opencv/cvat). ```bash - sudo apt-get install -y git + sudo apt-get --no-install-recommends install -y git git clone https://github.com/opencv/cvat cd cvat ``` @@ -103,7 +103,7 @@ server. Proxy is an advanced topic and it is not covered by the guide. curl https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' sudo apt-get update - sudo apt-get install -y google-chrome-stable + sudo apt-get --no-install-recommends install -y google-chrome-stable ``` - Open the installed Google Chrome browser and go to [localhost:8080](http://localhost:8080). From 0fa7a26860cc4a70e87ec8b7b3ff1a1aec28d320 Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Thu, 5 Mar 2020 11:12:16 +0530 Subject: [PATCH 5/9] Some debian package manager tweaks By default, Ubuntu or Debian based "apt" or "apt-get" system installs recommended but not suggested packages . By passing "--no-install-recommends" option, the user lets apt-get know not to consider recommended packages as a dependency to install. This results in smaller downloads and installation of packages . Refer to blog at [Ubuntu Blog](https://ubuntu.com/blog/we-reduced-our-docker-images-by-60-with-no-install-recommends) . --- components/cuda/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/cuda/README.md b/components/cuda/README.md index 8255615f4c4d..a6ecbfefba1b 100644 --- a/components/cuda/README.md +++ b/components/cuda/README.md @@ -13,10 +13,10 @@ sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt-get update sudo apt-cache search nvidia-* # find latest nvidia driver -sudo apt-get install nvidia-* # install the nvidia driver -sudo apt-get install mesa-common-dev -sudo apt-get install freeglut3-dev -sudo apt-get install nvidia-modprobe +sudo apt-get --no-install-recommends install nvidia-* # install the nvidia driver +sudo apt-get --no-install-recommends install mesa-common-dev +sudo apt-get --no-install-recommends install freeglut3-dev +sudo apt-get --no-install-recommends install nvidia-modprobe ``` #### Reboot your PC and verify installation by `nvidia-smi` command. From f3815d411c17c6c2d22d22da142702be2b542264 Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Thu, 5 Mar 2020 13:17:49 +0530 Subject: [PATCH 6/9] added packages apt-utils and python3-dev Because Github CI build is 1. Slow and in log it is showing because "apt-utils" not installed 2. CI build exits with error while installing python pip packages --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c1e466d41f49..9b95698e4aae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,8 +27,10 @@ RUN apt-get update && \ add-apt-repository ppa:mc3man/gstffmpeg-keep -y && \ apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends install -yq \ - apache2 \ + apache2 \ apache2-dev \ + apt-utils \ + build-essential \ libapache2-mod-xsendfile \ supervisor \ ffmpeg \ From abeac641c6733e5b2caa9add2d7f9155c911d90b Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Thu, 5 Mar 2020 13:18:48 +0530 Subject: [PATCH 7/9] added packages apt-utils , python3-dev Because CI build is 1. Slow and in log it is showing because "apt-utils" not installed 2. CI build exits with error while installing python pip packages --- Dockerfile.ci | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile.ci b/Dockerfile.ci index cc3d8f98f12f..e53839a307a0 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -8,8 +8,11 @@ RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - & curl https://deb.nodesource.com/setup_9.x | bash - && \ apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends install -yq \ + apt-utils \ + build-essential \ google-chrome-stable \ - nodejs && \ + nodejs \ + python3-dev && \ rm -rf /var/lib/apt/lists/*; RUN python3 -m pip install --no-cache-dir -r /tmp/requirements/${DJANGO_CONFIGURATION}.txt From 22f69a34c120ccb96dce8241ff54bf61caf0e502 Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Fri, 6 Mar 2020 15:57:54 +0530 Subject: [PATCH 8/9] Update install.sh --- components/openvino/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/openvino/install.sh b/components/openvino/install.sh index fdd08a963a83..159ff32d1b43 100755 --- a/components/openvino/install.sh +++ b/components/openvino/install.sh @@ -22,7 +22,7 @@ cd /tmp/components/openvino tar -xzf `ls | grep "openvino_toolkit"` cd `ls -d */ | grep "openvino_toolkit"` -apt-get update && apt-get install -y sudo cpio && \ +apt-get update && apt-get --no-install-recommends install -y sudo cpio && \ if [ -f "install_cv_sdk_dependencies.sh" ]; then ./install_cv_sdk_dependencies.sh; \ else ./install_openvino_dependencies.sh; fi && SUDO_FORCE_REMOVE=yes apt-get remove -y sudo From 7b52edbd11799a7aebf5d1a6c7f59ccaf8a73ecd Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Mon, 9 Mar 2020 13:05:52 +0530 Subject: [PATCH 9/9] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9b95698e4aae..54c8bed113c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,7 @@ RUN apt-get update && \ add-apt-repository ppa:mc3man/gstffmpeg-keep -y && \ apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends install -yq \ - apache2 \ + apache2 \ apache2-dev \ apt-utils \ build-essential \