Error in Docker Container, "unknown error: DevToolsActivePort file doesn't exist"
I'm trying to run a program in a Docker container using Splinter. Here is my Dockerfile
FROM python:3.7-alpine
COPY requirements.txt .
RUN apk update && \
apk add make automake gcc g++ subversion python3-dev && \
apk add gcc musl-dev python3-dev libffi-dev openssl-dev && \
apk add chromium chromium-chromedriver && \
pip install -r /requirements.txt && \
rm -rf /root/.[acpw]* ipaexg00301*
COPY . /app
After creating the container and running my code in it I get the following error:
Traceback (most recent call last):
File "/app/youversion_ingress.py", line 387, in
Running my script locally on my machine works fine so it must be something within Docker container. Input and comments would be appreciated.
I also just tried this Docker script and got another error.
FROM python:3.7-alpine
COPY requirements.txt .
RUN echo "http://dl-4.alpinelinux.org/alpine/v3.14/main" >> /etc/apk/repositories && \
echo "http://dl-4.alpinelinux.org/alpine/v3.14/community" >> /etc/apk/repositories
RUN apk update && \
apk add make automake gcc g++ subversion python3-dev && \
apk add gcc musl-dev python3-dev libffi-dev openssl-dev && \
apk add chromium chromium-chromedriver && \
pip install selenium && \
pip install -r /requirements.txt && \
rm -rf /root/.[acpw]* ipaexg00301*
ENV CHROME_BIN=/usr/bin/chromium-browser \
CHROME_PATH=/usr/lib/chromium/
COPY . /app
New Error Message selenium.common.exceptions.WebDriverException: Message: Service chromedriver unexpectedly exited. Status code was: 127
@oliverdixon85 These are chromedriver errors, so your issue isn't splinter related. There's nothing we can do from this side.
However, this is probably a permissions issue or a path issue. If chromedriver isn't in the system PATH, you can try specifying the path using a Service object:
https://www.selenium.dev/documentation/webdriver/getting_started/upgrade_to_selenium_4/#python-1
https://www.selenium.dev/selenium/docs/api/py/webdriver_chrome/selenium.webdriver.chrome.service.html#module-selenium.webdriver.chrome.service