# cat Dockerfile
FROM openjdk:8-alpine
WORKDIR /
ADD ./target/*.jar app.jar
EXPOSE 9999
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT [“/docker-entrypoint.sh”]
CMD [“java”,”-server”,”-Duser.timezone=GMT+08″,”-jar”,”/app.jar”]
# cat docker-entrypoint.sh
#!/bin/sh
set -e
需要做的操作,比如更改文件夹权限,或者其他命令
exec “$@”