1. centos7-java8基础镜像构建
FROM centos:7# 作者信息LABEL maintainer="liushiqi"# install timezone gccENV ENVIRONMENT DOCKER_PRODRUN cd / && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& yum makecache \&& yum install -y wget aclocal automake autoconf make gcc gcc-c++ python-devel mysql-devel bzip2 libffi-devel epel-release \&& yum clean all# cd /optWORKDIR /opt# copy jdk8 to /opt, and decompressionADD jre-8u333-linux-x64.tar.gz /opt# set jdk8 envENV JAVA_HOME=/opt/jre1.8.0_333ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarENV PATH=$JAVA_HOME/bin:$PATH# exec java -versionCMD ["java","-version"]
2. Docker 容器镜像无法正常启动,日志抛出Unable to access jarfile问题的解决方法
java 文件目录错误
3. spring boot 打包后,执行报错“no main manifest attribute, in /app.jar”解决办法
pom.xml 中新增打包插件:
<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><version>2.1.3.RELEASE</version></plugin></plugins></build>
