1.编写docker文件
FROM openjdk:8-jdk-alpine
MAINTAINER 1073769166@qq.com
LABEL description="品吸机单独管理后台"
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 添加字体 (如果二维码显示不出来)
RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig
RUN mkdir /soft
WORKDIR /soft
VOLUME ["/data/logs","/data/storage","/data/temp"]
COPY manager-appDev-0.1-exec.jar /soft/app.jar
EXPOSE 8073
ENTRYPOINT java $JAVA_OPTS -Dfile.encoding=utf-8 -jar /soft/app.jar "$0" "$@"
2.编译镜像文件
docker build -t Manager .
3.运行镜像
docker ps
docker run -i -t --name manager_single 935d530af418 --spring.redis.host=192.168.50.84
docker run -i -t -d -p 8073:8073 -e JAVA_OPTS="-Xmx1G -Xms512M" --name manager_single --restart=always aeb7e4e5bf7f --spring.redis.host=192.168.50.84
docker run -i -t -d -p 8073:8073 -e JAVA_OPTS="-Xmx1G -Xms512M" --name manager_single --restart=always -v /D/Docker:/soft/logs/ -v /D/Docker:/soft/storage/ -v /D/Docker:/soft/temp/ f7e37c794679 --spring.redis.host=192.168.50.84
4.导出镜像
docker save -o imager_name.tar REPOSITORY:TAG
5.镜像导入
docker load<D:\Docker\images\manager_single.tar