Dockerfile aktualisiert
This commit is contained in:
@@ -31,10 +31,11 @@ RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add
|
||||
apt-get install -y google-chrome-stable --no-install-recommends && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 4. Passenden Chromedriver installieren (NEUE, NOCH ROBUSTERE METHODE)
|
||||
# Dieser Block holt sich direkt die URL für den neuesten stabilen Chromedriver,
|
||||
# ohne auf einen Versionsabgleich angewiesen zu sein.
|
||||
RUN DRIVER_URL=$(wget -qO- "https://googlechromelabs.github.io/chrome-for-testing/latest-stable-versions.json" | grep -o '"linux64","url":"[^"]*' | grep 'chromedriver' | cut -d '"' -f 6) \
|
||||
# 4. Passenden Chromedriver installieren (FINALE, ROBUSTE PYTHON-METHODE)
|
||||
# Dieser Block nutzt Python, um die JSON-Antwort von Google sicher zu parsen.
|
||||
# Das ist weitaus stabiler als die vorherigen Versuche mit grep/cut.
|
||||
RUN apt-get update && apt-get install -y wget unzip \
|
||||
&& DRIVER_URL=$(wget -qO- "https://googlechromelabs.github.io/chrome-for-testing/latest-stable-versions.json" | python -c "import json, sys; print(next(d['url'] for d in json.load(sys.stdin)['channels']['Stable']['downloads']['chromedriver'] if d['platform'] == 'linux64'))") \
|
||||
&& wget -q "${DRIVER_URL}" -O /tmp/chromedriver.zip \
|
||||
&& unzip /tmp/chromedriver.zip -d /usr/local/bin/ \
|
||||
&& mv /usr/local/bin/chromedriver-linux64/chromedriver /usr/local/bin/ \
|
||||
|
||||
Reference in New Issue
Block a user