dockerfiles修改方式:
# Using Centos for base image
FROM openjdk:8-jdk
## 镜像维护者
MAINTAINER lh
## 配置jar
#RUN mkdir -p /usr/soft
COPY capability.jar /home/capability.jar
RUN chmod 777 /home/capability.jar
RUN groupadd -g 1002 myuser && \
useradd -u 1002 -g 1002 -m -s /usr/sbin/nologin myuser
# 切换到 myuser 用户
USER myuser
## 内部开启服务端口
EXPOSE 80
## 最后启动sshd进程,防止容器启动后不见
CMD ["nohup","java","-Xms1586m","-Xmx3096m","-XX:MaxPermSize=1024M","-XX:SurvivorRatio=8","-XX:+UseConcMarkSweepGC","-jar","-Dserver.port=80","/home/capability.jar" , ">capability_log.out &" ]
HEALTHCHECK --timeout=3s --interval=5s --retries=6 \
CMD curl http://localhost:80 || exit 1