Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

functions 709B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. log() {
  3. echo "$(date +"[%Y-%m-%d %T,%3N]") <docker-entrypoint> $*"
  4. }
  5. set_java_home() {
  6. JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/jre/bin/java::")
  7. if [ ! -d "${JAVA_HOME}" ]; then
  8. # For some reason readlink failed so lets just make some assumptions instead
  9. # We're assuming openjdk 8 since thats what we install in Dockerfile
  10. arch=`dpkg --print-architecture 2>/dev/null`
  11. JAVA_HOME=/usr/lib/jvm/java-8-openjdk-${arch}
  12. fi
  13. }
  14. instPkg() {
  15. for pkg in $*; do
  16. if [ $(dpkg-query -W -f='${Status}' "${pkg}" 2>/dev/null | grep -c "ok installed") -eq 0 ];
  17. then
  18. apt-get -qy install "${pkg}";
  19. fi
  20. done
  21. }