prepare 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. set -e
  3. cat > /etc/dpkg/dpkg.cfg.d/01_nodoc <<EOF
  4. # Delete locales
  5. path-exclude=/usr/share/locale/*
  6. # Delete man pages
  7. path-exclude=/usr/share/man/*
  8. # Delete docs
  9. path-exclude=/usr/share/doc/*
  10. path-include=/usr/share/doc/*/copyright
  11. EOF
  12. export LC_ALL=C
  13. export DEBIAN_FRONTEND=noninteractive
  14. CLEAR_DOCKER_CACHE=2020-05-28
  15. minimal_apt_get_install='apt-get install -y --no-install-recommends'
  16. apt-get update
  17. apt-get dist-upgrade -y --no-install-recommends
  18. $minimal_apt_get_install software-properties-common
  19. $minimal_apt_get_install build-essential checkinstall git-core \
  20. zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev \
  21. libncurses5-dev libffi-dev libxml2-dev libxslt-dev curl libcurl4-openssl-dev libicu-dev \
  22. graphviz libmysqlclient-dev libpq-dev libsqlite3-dev \
  23. locales tzdata shared-mime-info iputils-ping
  24. locale-gen en_US.UTF-8
  25. update-locale LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8
  26. gem update --system --no-document
  27. gem update bundler --conservative --no-document
  28. apt-get purge -y python3* rsyslog rsync manpages
  29. apt-get -y clean
  30. apt-get -y autoremove
  31. rm -rf /var/lib/apt/lists/*
  32. rm -rf /usr/share/doc/
  33. rm -rf /usr/share/man/
  34. rm -rf /usr/share/locale/
  35. rm -rf /var/log/*
  36. # Install the latest jq for JqAgent
  37. curl -fsSL -o /usr/local/bin/jq https://github.com/stedolan/jq/releases/latest/download/jq-linux64
  38. chmod +x /usr/local/bin/jq
  39. mkdir -p /app
  40. chmod -R g=u /etc/passwd /app