1 准备Dockerfile
FROM eclipse-temurin:8-jdk-alpine RUN rm -f /etc/localtime && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/shanghai" > /etc/timezone && mkdir /opt/app COPY *.jar /opt/app/ CMD ["java", "-Dsentinel.dashboard.auth.username=sentinel","-Dsentinel.dashboard.auth.password=d%FIK2Poqj", "-jar", "/opt/app/sentinel-dashboard-1.8.6.jar"]
2 本地需要把
eclipse-temurin:8-jdk-alpine 这个镜像下载好,使用docker pull eclipse-temurin:8-jdk-alpine命令
3 把文件从windows 复制到wsl的目录下
cp /mnt/c/deploy/sentinel/* /home/maxz39/sentinel
/mnt/c就表示WINDOWS下的c盘
要保证Dockerfile和对应的jar在同一个目录下
4 敲命令
进到Dockerfile所在的目录下 敲命令 docker build -t sentinel-dashboard-password:1.8.6
标签:怎么,app,jar,dashboard,sentinel,镜像,docker,Dockerfile From: https://www.cnblogs.com/juniorMa/p/18429111