Tomcat을 docker 환경에서 selenium 사용시 에러

tomcat을 docker 환경에서 selenium chrome 브라우저로 사용하려니 에러가 발생하였다.

 

/root/.cache/selenium/chromedriver/linux64/122.0.6261.128/chromedriver: error while loading shared libraries: libglib-2.0.so.0: cannot open shared object file: No such file or directory

libglib2.0 라이브러리 없다는 에러

 

apt update
apt install -y libglib2.0

라이브러리 설치 후 해결

 

/root/.cache/selenium/chromedriver/linux64/122.0.6261.128/chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

libnss3 라이브러리 없다는 에러

 

apt update
apt install -y libnss3

라이브러리 설치  후 해결

 

Could not start a new session. Response code 500. Message: unknown error: cannot find Chrome binary

크롬 설치 안되어있다는 에러

 

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt -y install ./google-chrome-stable_current_amd64.deb

크롬 설치 후 해결