dockerfile 先把文件变成镜像
FROM cbtai-hao.tencentcloudcr.com/cbtai/javadockerfunc:0.1.1
EXPOSE 8080
COPY build/libs/app.jar /opt/app.jar
WORKDIR /opt
ENTRYPOINT exec java $JAVA_OPTS -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 app.jar
镜像保存成tar
docker save 镜像名:版本号 > 保存位置/func-informationyuan-latest.tar
把镜像打成tar包
tar -cvf data.tar /home/data
ping 通服务器把tar包放到指定的位置
``config文件
logging.com.cbtai.information.config=com.cbtai.information.config/logback-spring.xml
management.endpoint.health.show-details=always
server.port=22083
server.servlet.context-path=/func-information
func.sourceip=192.168.0.35
func.rest_timeout=100000
func.thingTableName=tg_information_qu_thing
func.ppTableName=tg_information_qu_property
func.ppKeyTableName=tg_information_qu_property_key
func.ppValueTableName=tg_information_qu_property_value
func.cateTableName=tg_information_qu_category
func.cateKeyTableName=tg_information_qu_cate_key
func.cateValueTableName=tg_information_qu_cate_value
func.custTableName=cust_proj
在服务器里启动docker
docker run -d --name func-informationyuan -p 22080:8080 -v /home/hao/tars/yuanMeng/config:/opt/config func-informationyuan:latest