@@ -4,10 +4,10 @@ FROM ubuntu:18.04
4
4
# =======================================
5
5
# Install Python and Basic Python Tools
6
6
# =======================================
7
- RUN apt-get update && apt-get install -y python python-pip python-setuptools python-dev python-distribute
8
- # Above command on Windows
9
- # RUN apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update
10
- # RUN apt-get install -y python python-pip python-setuptools python-dev python-distribute
7
+ RUN apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update
8
+ RUN apt-get install -y python3 python3-pip python3-setuptools python3-dev python-distribute
9
+ RUN alias python=python3
10
+ RUN echo "alias python=python3" >> ~/.bashrc
11
11
12
12
# =================================
13
13
# Install Bash Command Line Tools
@@ -32,13 +32,6 @@ RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-ke
32
32
apt-get -yqq install google-chrome-stable && \
33
33
rm -rf /var/lib/apt/lists/*
34
34
35
- # ==================
36
- # Configure Chrome
37
- # ==================
38
- RUN dpkg-divert --add --rename --divert /opt/google/chrome/google-chrome.real /opt/google/chrome/google-chrome && \
39
- echo "#!/bin/bash\n exec /opt/google/chrome/google-chrome.real --disable-setuid-sandbox --no-sandbox \"\$ @\" " > /opt/google/chrome/google-chrome && \
40
- chmod 755 /opt/google/chrome/google-chrome
41
-
42
35
# =================
43
36
# Install Firefox
44
37
# =================
@@ -61,6 +54,20 @@ RUN Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &
61
54
RUN export DISPLAY=:99
62
55
RUN exec "$@"
63
56
57
+ # =======================
58
+ # Update Python Version
59
+ # =======================
60
+ RUN apt-get update -y
61
+ RUN apt-get -qy --no-install-recommends install python3.8
62
+ RUN rm /usr/bin/python3
63
+ RUN ln -s python3.8 /usr/bin/python3
64
+
65
+ # =============================================
66
+ # Allow Special Characters in Python Programs
67
+ # =============================================
68
+ RUN export PYTHONIOENCODING=utf8
69
+ RUN echo "export PYTHONIOENCODING=utf8" >> ~/.bashrc
70
+
64
71
# =====================
65
72
# Set up SeleniumBase
66
73
# =====================
@@ -71,11 +78,11 @@ COPY requirements.txt /SeleniumBase/requirements.txt
71
78
COPY setup.py /SeleniumBase/setup.py
72
79
RUN find -name '*.pyc' -delete
73
80
RUN find -name __pycache__ -delete
74
- RUN pip install --upgrade pip
75
- RUN pip install --upgrade setuptools
76
- RUN pip install --upgrade setuptools-scm
77
- RUN cd /SeleniumBase && ls && pip install -r requirements.txt --upgrade
78
- RUN cd /SeleniumBase && python setup.py develop
81
+ RUN pip3 install --upgrade pip
82
+ RUN pip3 install --upgrade setuptools
83
+ RUN pip3 install --upgrade setuptools-scm
84
+ RUN cd /SeleniumBase && ls && pip3 install -r requirements.txt --upgrade
85
+ RUN cd /SeleniumBase && python3 setup.py develop
79
86
RUN seleniumbase install chromedriver
80
87
RUN seleniumbase install geckodriver
81
88
0 commit comments