build.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/sh
  2. # Copyright 2015 The Kubernetes Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # Install prerequisites.
  16. apt-get update
  17. apt-get install -y -q --no-install-recommends \
  18. curl ca-certificates make g++ sudo bash
  19. # Install Fluentd.
  20. /usr/bin/curl -sSL https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent2.sh | sh
  21. # Change the default user and group to root.
  22. # Needed to allow access to /var/log/docker/... files.
  23. sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent
  24. # Install the Elasticsearch Fluentd plug-in.
  25. # http://docs.fluentd.org/articles/plugin-management
  26. td-agent-gem install --no-document fluent-plugin-kubernetes_metadata_filter -v 0.24.0
  27. td-agent-gem install --no-document fluent-plugin-elasticsearch -v 1.5.0
  28. # Remove docs and postgres references
  29. rm -rf /opt/td-agent/embedded/share/doc \
  30. /opt/td-agent/embedded/share/gtk-doc \
  31. /opt/td-agent/embedded/lib/postgresql \
  32. /opt/td-agent/embedded/bin/postgres \
  33. /opt/td-agent/embedded/share/postgresql
  34. apt-get remove -y make g++
  35. apt-get autoremove -y
  36. apt-get clean -y
  37. rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*