机器环境
本实践将在 Ubuntu 22.04.3LTS 系统上进行安装测试
docker 版本Docker Engine - Community 24.0.6
,原则上docker版本无影响
下面是一些Dockfile的应用模板
Springboot应用模板
FROM java:8-jre-alpine
WORKDIR /app
COPY ./target/bingo-demo-springboot-0.0.1-SNAPSHOT.jar ./app.jar
EXPOSE 8089
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone
CMD java -Djava.security.egd=file:/dev/urandom -jar app.jar
httpd应用模板
FROM httpd:latest
ADD ./dist/ /usr/local/apache2/htdocs/
EXPOSE 80
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone
CMD /usr/local/apache2/bin/httpd -D FOREGROUND