-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Can't able to install seleniumbase chromedriver in docker #3566
-
Hi, i have a hard time installing seleniumbase latest chromedriver inside of docker image. Can you help me what is the possible cause of this issue?
Dockerfile:
FROM python:3.11-slim
# Set environment variables
ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
# Install required dependencies: curl, wget, Google Chrome
RUN apt-get update && apt-get install -y \
sudo \
wget \
curl \
ca-certificates \
unzip \
gnupg \
fonts-liberation \
libappindicator3-1 \
libasound2 \
libxss1 \
libnss3 \
libgdk-pixbuf2.0-0 \
libgtk-3-0 \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install -y ./google-chrome-stable_current_amd64.deb
RUN rm ./google-chrome-stable_current_amd64.deb
# Set the working directory
WORKDIR /app
# Copy only the requirements.txt first to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --upgrade pip wheel setuptools
RUN pip install -r requirements.txt
RUN pip install seleniumbase
# Install ChromeDriver using seleniumbase
RUN seleniumbase install chromedriver
# Copy the rest of the project files into the container
COPY . .
# Default command to run the tests
CMD cd tests && pytest test_login.py -s -q -x --dashboard --html=report.html --save-screenshot --maximize
Beta Was this translation helpful? Give feedback.
All reactions
Use the included SeleniumBase Dockerfile:
https://github.com/seleniumbase/SeleniumBase/blob/master/Dockerfile
Replies: 1 comment 15 replies
-
Use the included SeleniumBase Dockerfile:
https://github.com/seleniumbase/SeleniumBase/blob/master/Dockerfile
Beta Was this translation helpful? Give feedback.
All reactions
-
If you're running from Docker, you can't see the browser. You could take screenshots though, and then transfer those to your machine to see what was there.
Beta Was this translation helpful? Give feedback.
All reactions
-
I see, i think it is very tricky to be able to show the UI of chrome browser that running from Docker.
I successfully integrate Docker to my seleniumbase framework and my next goal is to see the UI of chromebrowser that running from docker, however it is very tricky to accomplish.
Thank you for the information.
Beta Was this translation helpful? Give feedback.
All reactions
-
But if you have already accomplished this before, you can also share with us how we can do it. @mdmintz
Beta Was this translation helpful? Give feedback.
All reactions
-
Only by taking screenshots. You can use Docker Desktop to transfer any screenshots to your regular machine.
Beta Was this translation helpful? Give feedback.
All reactions
-
Have you tried to run from docker and still see the browser running?
Beta Was this translation helpful? Give feedback.