Dockerfile 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. FROM ubuntu:18.04
  2. MAINTAINER Bernhard Buhl <buhl@buhl-consulting.com.cy>
  3. RUN echo "Europe/Rome" > /etc/timezone
  4. RUN apt-get update -q && \
  5. export DEBIAN_FRONTEND=noninteractive && \
  6. apt-get install -y --no-install-recommends tzdata
  7. RUN dpkg-reconfigure -f noninteractive tzdata
  8. # Install packages
  9. RUN apt-get update -q && \
  10. export DEBIAN_FRONTEND=noninteractive && \
  11. apt-get install -y --no-install-recommends software-properties-common && \
  12. add-apt-repository universe && \
  13. apt-get update -q && \
  14. apt-get remove -y python3.6 && \
  15. apt-get install -y --no-install-recommends wget curl rsync netcat mg vim bzip2 zip unzip && \
  16. apt-get install -y --no-install-recommends libx11-6 libxcb1 libxau6 jq python3-setuptools python3-tk && \
  17. apt-get install -y --no-install-recommends lxde tightvncserver xvfb dbus-x11 x11-utils && \
  18. apt-get install -y --no-install-recommends xfonts-base xfonts-75dpi xfonts-100dpi && \
  19. apt-get install -y --no-install-recommends python-pip python3.7-dev python-qt4 python3-pip tk-dev && \
  20. apt-get install -y --no-install-recommends libssl-dev git jq firefox unzip && \
  21. wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
  22. dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install && \
  23. rm google-chrome-stable_current_amd64.deb && \
  24. apt-get autoclean -y && \
  25. apt-get autoremove -y && \
  26. apt-get clean && \
  27. rm -rf /var/lib/apt/lists/*
  28. # Install Baangt
  29. RUN git clone -b baangt-selenium-grid-v4 https://gogs.earthsquad.global/athos/baangt && \
  30. pip3 install -r baangt/requirements.txt && \
  31. rm -rf baangt/browserDrivers && \
  32. mkdir baangt/browserDrivers && \
  33. cd baangt/browserDrivers && \
  34. wget http://selenium-release.storage.googleapis.com/4.0-alpha5/selenium-server-4.0.0-alpha-5.jar && \
  35. BASE_URL=https://chromedriver.storage.googleapis.com && \
  36. VERSION=$(curl -sL "$BASE_URL/LATEST_RELEASE") && \
  37. curl -sL "$BASE_URL/$VERSION/chromedriver_linux64.zip" -o chromedriver.zip && \
  38. unzip chromedriver.zip && \
  39. GECKODRIVER_VERSION=`curl https://github.com/mozilla/geckodriver/releases/latest | grep -Po 'v[0-9]+.[0-9]+.[0-9]+'` && \
  40. wget https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz && \
  41. tar -zxf geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz && \
  42. chmod +x geckodriver && \
  43. rm geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz && \
  44. cd ../..
  45. WORKDIR /root/
  46. # VNC-Server
  47. RUN mkdir -p /root/.vnc
  48. COPY xstartup /root/.vnc/
  49. RUN chmod a+x /root/.vnc/xstartup
  50. RUN touch /root/.vnc/passwd && \
  51. /bin/bash -c "echo -e 'password\npassword\nn' | vncpasswd" > /root/.vnc/passwd && \
  52. chmod 400 /root/.vnc/passwd && \
  53. chmod go-rwx /root/.vnc && \
  54. touch /root/.Xauthority
  55. COPY start-vncserver.sh /root/
  56. COPY baangt.sh /root/
  57. COPY getdrivers.sh /root/
  58. RUN chmod a+x /root/start-vncserver.sh && \
  59. chmod a+x /root/baangt.sh && \
  60. chmod a+x /root/getdrivers.sh && \
  61. /root/getdrivers.sh && \
  62. echo "mycontainer" > /etc/hostname && \
  63. echo "127.0.0.1 localhost" > /etc/hosts && \
  64. echo "127.0.0.1 mycontainer" >> /etc/hosts
  65. EXPOSE 5901
  66. ENV USER root
  67. CMD [ "/root/start-vncserver.sh" ]