Open 0xACE3 opened 1 year ago
https://github.com/Hudrolax/uc-docker This is my working example of Dockered python script for using undetected chromedriver in GUI mode, based on Ubuntu image. https://github.com/Hudrolax/uc-docker-alpine And this is the same, but based on Alpine Linux and Chromium.
https://github.com/Hudrolax/uc-docker This is my working example of Dockered python script for using undetected chromedriver in GUI mode, based on Ubuntu image. https://github.com/Hudrolax/uc-docker-alpine And this is the same, but based on Alpine Linux and Chromium.
Thank you.
FROM python # common base image for most of my images
RUN pip install --no-cache-dir --upgrade pip
# need to install a full GUI, apparently
RUN apt update \
&& apt install -y \
chromium \
chromium-driver \
chromium-sandbox \
xvfb \
x11vnc \
fluxbox \
xterm \
libffi-dev \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# install your project
COPY ./py/ /tmp/py
WORKDIR /tmp/py
RUN pip install --no-cache-dir .
RUN rm -rf /tmp/py
# not sure if this is necessary
# Create a non-root user
RUN groupadd -r pwuser && useradd -r -g pwuser -G audio,video pwuser \
&& mkdir -p /home/pwuser/Downloads \
&& chown -R pwuser:pwuser /home/pwuser
# Switch to the non-root user
USER pwuser
# run your project
ENTRYPOINT ["python", "-c", "from iaexample import main; main()"]
Code
Dockerfile
error
How can I fix this and run the chrome driver in non-headless mode in docker?