Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Can't able to install seleniumbase chromedriver in docker #3566

Answered by mdmintz
jeremyyymrcs asked this question in Q&A
Discussion options

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?

image (24)

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
You must be logged in to vote

Replies: 1 comment 15 replies

Comment options

You must be logged in to vote
15 replies
Comment options

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.

Comment options

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.

Comment options

But if you have already accomplished this before, you can also share with us how we can do it. @mdmintz

Comment options

Only by taking screenshots. You can use Docker Desktop to transfer any screenshots to your regular machine.

Comment options

Have you tried to run from docker and still see the browser running?

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /