构建 jdk8+selenium 镜像运行会产生僵尸进行

312 天前
 dunhanson

1 、基础镜像

FROM debian:bullseye
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone && mkdir -p /opt
ADD chromedriver /opt/chromedriver
RUN chmod +x /opt/chromedriver
ADD OpenJDK8U-jdk_x64_linux_hotspot_8u352b08.tar.gz /opt
ENV JAVA_HOME /opt/jdk8u352-b08
ENV PATH PATH $PATH:$JAVA_HOME/bin
ENV LANG C.UTF-8
ENV LANGUAGE C.UTF-8
ENV LC_ALL C.UTF-8
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && apt-get update -y && apt-get install chromium -y && chromium -version && apt-get install ttf-wqy-microhei ttf-wqy-zenhei -y 
CMD ["bash"]

2 、java 镜像

FROM harbor.******.com/library/temurin-jdk8-selenium:109.0.5414.74
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
ADD target/moose-custom-api.jar /data/java/
WORKDIR /data/java/
RUN echo '' > application.yml
ENTRYPOINT ["java",  "-jar", "moose-custom-api.jar", "--spring.config.location=application.yml"]

3 、僵尸进程

4 、措施(无用)

    try {
    	...
    } finally {
    	// exit
    	driver.close();
    	driver.quit();
    }
801 次点击
所在节点    程序员
1 条回复
dunhanson
311 天前
已解决,用远程的 selenium

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/953351

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX