Install chromedriver in docker container12/30/2023 ![]() As usual, I’m sure this isn’t the only way to go about it. So far everything I’ve done this with has successfully found chromedriver in the path automatically, but other tools may require passing an argument to point to the right binary. If then echo "VERSION MISMATCH" exit 1 fi Wget `cat chrome_version`/chromedriver_linu圆4.zip & \ĭRIVER_MAJOR=$(chromedriver -version | sed 's/ChromeDriver \(*\).*/\1/g') & \Įcho "chrome version: $BROWSER_MAJOR" & \Įcho "chromedriver version: $DRIVER_MAJOR" & \ ![]() This is very convenient benefit of the relatively recent change to have the two programs follow the same versioning scheme. Then we can use this major version to look up the latest chromedriver release from. That regex just pulls out the numeric portion of the version before the first dot. First, we find out what the latest version of Chrome just installed is: BROWSER_MAJOR=$(google-chrome -version | sed 's/Google Chrome \(*\).*/\1/g') This isn’t anything special any way of installing Chrome should work. Tee -a /etc/apt//google.list & \Īpt-get install -y google-chrome-stable libxss1 The following should work on any Debian/Ubuntu-based image, but should be adaptable to others.įirst, installed Chrome, including dependencies for puppeteer since that’s also often required. What I do now is build a Docker image that installs the latest Chrome, checks which version it is, and then installs the specific version of chromedriver that is compatible. Keeping the two in sync in any environment where these test tools run is a must, and I’ve long since given up on trying to do this manually on any system outside of a Docker image. I keep running into this problem where UI test tools need a Chrome browser installed, but come packaged in npm with an outdated chromedriver dependency.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |