Guest User

Dockerfile x11docker/google-earth

a guest
Sep 9th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.16 KB | None | 0 0
  1. # x11docker/google-earth
  2. #
  3. # Run Google Earth in docker.
  4. # Use x11docker to run GUI apps in docker.
  5. # Get x11docker script from github: https://github.com/mviereck/x11docker
  6. #
  7. # NOTE: Download of Google Earth is disabled in this Dockerfile,
  8. # because it is not allowed by copyright to publish
  9. # the binaries on Docker Hub. But it is allowed to
  10. # download them during your build.
  11. #
  12. # To install Google Earth:
  13. # * save this Dockerfile on your computer. Get it here:
  14. # https://raw.githubusercontent.com/mviereck/dockerfile-x11docker-google-earth/master/Dockerfile
  15. # * enable lines 'RUN wget ...' and 'RUN dpkg ...'
  16. # * build image with command:
  17. # docker build -t google-earth /PATH/TO/DOCKERFILE
  18. #
  19. # * Run image with command:
  20. # x11docker google-earth
  21.  
  22. FROM ubuntu:xenial
  23.  
  24. RUN apt-get update
  25.  
  26. # Set environment variables
  27. #ENV HOME /root
  28. #ENV DEBIAN_FRONTEND noninteractive
  29. #ENV LC_ALL en_US.UTF-8
  30. #ENV LANG en_US.UTF-8
  31. #ENV LANGUAGE en_US.UTF-8
  32. #RUN locale-gen en_US.UTF-8
  33.  
  34. # fix problems with dictionaries-common
  35. # See https://bugs.launchpad.net/ubuntu/+source/dictionaries-common/+bug/873551
  36. RUN apt-get install -y apt-utils
  37. RUN /usr/share/debconf/fix_db.pl
  38. RUN apt-get install -y -f
  39.  
  40. # install wget and some dependencies for google earth
  41. # x11docker doesn't need X/xorg to be installed, but google earth
  42. # needs a lot of its dependencies.
  43. #
  44. RUN apt-get install -y xorg
  45. RUN apt-get install -y mesa-utils mesa-utils-extra
  46. RUN apt-get install -y libfreeimage3
  47. RUN apt-get install -y --no-install-recommends wget
  48. RUN apt-get install -y --no-install-recommends xdg-utils
  49. RUN apt-get install -y gdebi-core
  50. RUN apt-get install -y tar xz-utils
  51.  
  52.  
  53. ####################################################
  54. # Enable the following two commands to download and
  55. # install Google Earth current
  56.  
  57. RUN wget --no-check-certificate https://dl.google.com/dl/earth/client/current/google-earth-stable_current_amd64.deb
  58. RUN gdebi -n google-earth-stable_current_amd64.deb
  59.  
  60. ####################################################
  61.  
  62.  
  63. # Patch for google earth from amirpli to fix some bugs in google earth qt libs
  64. # Without this patch, google earth can suddenly crash without a helpful error message.
  65. # See https://productforums.google.com/forum/?fromgroups=#!category-topic/earth/linux/_h4t6SpY_II%5B1-25-false%5D
  66. # and Readme-file https://docs.google.com/file/d/0B2F__nkihfiNMDlaQVoxNVVlaUk/edit?pli=1 for details
  67. #
  68. RUN mkdir -p /opt/google/earth/free
  69. RUN touch /usr/bin/google-earth
  70. RUN cd /opt/google/earth
  71. RUN cp -a /opt/google/earth/free /opt/google/earth/free.newlibs
  72. RUN wget --no-check-certificate -P /opt/google/earth/free.newlibs
  73. RUN tar xvf /opt/google/earth/free.newlibs/ge7.1.1.1580-0.x86_64-new-qt-libs-debian7-ubuntu12.tar.xz
  74. RUN mv /usr/bin/google-earth /usr/bin/google-earth.old
  75. RUN ln -s /opt/google/earth/free.newlibs/googleearth /usr/bin/google-earth
  76.  
  77.  
  78. RUN apt-get clean
  79. RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  80.  
  81.  
  82. # create config file for google earth
  83. # * no tips on startup
  84. # * no tourguide filmstrip
  85. # * don't send usage stats to google
  86. # * disable texture compression to avoid ugly shapes
  87. RUN mkdir -p /etc/skel/.config/Google
  88. RUN echo '[General] \n\
  89. enableTips=false \n\
  90. UsageStats=false \n\
  91. [TourGuide] \n\
  92. Filmstrip\Enabled=false \n\
  93. [Render] \n\
  94. TextureCompression=false \n\
  95. ' > /etc/skel/.config/Google/GoogleEarthPlus.conf
  96.  
  97.  
  98.  
  99. # script to check if google-earth is installed; if not, show error&exit; if yes, run google-earth
  100. RUN echo '#! /bin/bash \n\
  101. command -v google-earth >/dev/null 2>&1 || { \n\
  102. echo "Error: Google Earth is not installed. Please enable installation of \n\
  103. Google Earth in Dockerfile und build docker image yourself. \n\
  104. See https://hub.docker.com/r/x11docker/google-earth/ for details and reasons. \n\
  105. To install Google Earth: \n\
  106. \n\
  107. * get Dockerfile from github: \n\
  108. https://raw.githubusercontent.com/mviereck/dockerfile-x11docker-google-earth/master/Dockerfile \n\
  109. * enable lines RUN wget ... and RUN gdebi ... \n\
  110. * build image with command: \n\
  111. docker build -t google-earth /PATH/TO/DOCKERFILE/ \n\
  112. (replace /PATH/TO/DOCKERFILE/ to where you saved the Dockerfile) \n\
  113. * Get script x11docker from github: https://github.com/mviereck/x11docker \n\
  114. * Run image with command: \n\
  115. x11docker google-earth" \n\
  116. exit 1 \n\
  117. } \n\
  118. case $DISPLAY in \n\
  119. "") echo "Need X server to start Google Earth. \n\
  120. To run GUI applications in docker, you can use x11docker. \n\
  121. Get x11docker from github: https://github.com/mviereck/x11docker \n\
  122. Run image with command: \n\
  123. x11docker google-earth" \n\
  124. exit 1 ;; \n\
  125. esac \n\
  126. if [ ! -e "$HOME/.config" ] ; then \n\
  127. cp -R /etc/skel/. $HOME/ \n\
  128. cp -R /etc/skel/* $HOME/ \n\
  129. fi \n\
  130. google-earth \n\
  131. ' > /usr/local/bin/start
  132. RUN chmod +x /usr/local/bin/start
  133.  
  134.  
  135. CMD start
Add Comment
Please, Sign In to add comment