#1.编写dockerfile
echo "FROM dockerhub.quklive.com/open/arm64v8/ubuntu:jdk8
RUN mkdir -p /opt/cloud_server/cloud
ENV LANG C.UTF-8
ENV JAVA_TOOL_OPTIONS -Dfile.encoding=UTF8
WORKDIR /opt/cloud_server/cloud
COPY cloud.jar /opt/cloud_server/cloud/cloud.jar #jar包路径
CMD ["java", "-Duser.timezone=Asia/Shanghai", "-Dfile.encoding=UTF8", "-jar", "cloud.jar", "--spring.config.location=/opt/cloud_server/cloud/bootstrap.yml"]
EXPOSE 18080 " > /opt/dockerfile/cloud/Dockerfile
#2.构建镜像
cd /opt/dockerfile/cloud && docker build -t ubuntu_arm64:cloud .
#3.启动镜像
docker run -itd --restart=always --name=cloud -p 18080:18080 -v /etc/localtime:/etc/localtime -v /var/log/cloud:/opt/cloud_server/cloud/logs -v /opt/cloud_server/cloud/bootstrap.yml:/opt/cloud_server/cloud/bootstrap.yml ubuntu_arm64:cloud
04-26
3778
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-15
122
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)