Skip to content

Commit 7a29bd1

Browse files
committed
Update the Dockerfile
1 parent 832bac1 commit 7a29bd1

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

Dockerfile

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ FROM ubuntu:18.04
44
#=======================================
55
# Install Python and Basic Python Tools
66
#=======================================
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
1111

1212
#=================================
1313
# 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
3232
apt-get -yqq install google-chrome-stable && \
3333
rm -rf /var/lib/apt/lists/*
3434

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\nexec /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-
4235
#=================
4336
# Install Firefox
4437
#=================
@@ -61,6 +54,20 @@ RUN Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &
6154
RUN export DISPLAY=:99
6255
RUN exec "$@"
6356

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+
6471
#=====================
6572
# Set up SeleniumBase
6673
#=====================
@@ -71,11 +78,11 @@ COPY requirements.txt /SeleniumBase/requirements.txt
7178
COPY setup.py /SeleniumBase/setup.py
7279
RUN find -name '*.pyc' -delete
7380
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
7986
RUN seleniumbase install chromedriver
8087
RUN seleniumbase install geckodriver
8188

0 commit comments

Comments
 (0)