zoukankan      html  css  js  c++  java
  • 谷粒商城sentinel打成镜像

    sentinel之前也简单的写过博客:https://www.cnblogs.com/dalianpai/p/12283155.html

    项目中是本地启动的,我直接打成镜像,这样用起来方便点,具体如下:

    [root@cicd sentinel]# pwd
    /wgr/sentinel
    [root@cicd sentinel]# ll
    total 20640
    -rw-r--r-- 1 root root      250 Aug 19 13:20 Dockerfile
    -rw-r--r-- 1 root root 21127853 Aug 19 12:32 sentinel-dashboard-1.6.3.jar
    [root@cicd sentinel]# cat Dockerfile
    FROM java:8
    VOLUME /tmp
    ADD sentinel-dashboard-1.6.3.jar app.jar
    RUN bash -c 'touch /app.jar'
    EXPOSE 8889
    ENTRYPOINT ["java","-Dserver.port=8889","-Dcsp.sentinel.dashboard.server=localhost:8889","-Dproject.name=sentinel-dashboard","-jar","/app.jar"]
    [root@cicd sentinel]#
    [root@cicd sentinel]# docker build -f Dockerfile -t sentinel:v1.6.3 .
    Sending build context to Docker daemon  21.13MB
    Step 1/6 : FROM java:8
     ---> d23bdf5b1b1b
    Step 2/6 : VOLUME /tmp
     ---> Using cache
     ---> 548bac3b1023
    Step 3/6 : ADD sentinel-dashboard-1.6.3.jar app.jar
     ---> Using cache
     ---> 7c923ddf190d
    Step 4/6 : RUN bash -c 'touch /app.jar'
     ---> Using cache
     ---> dd34df514bc2
    Step 5/6 : EXPOSE 8889
     ---> Using cache
     ---> 666b71adce7b
    Step 6/6 : ENTRYPOINT ["java","-Dserver.port=8889","-Dcsp.sentinel.dashboard.server=localhost:8889","-Dproject.name=sentinel-dashboard","-jar","/app.jar"]
     ---> Running in 55433508e9d6
    Removing intermediate container 55433508e9d6
     ---> f9e95128225c
    Successfully built f9e95128225c
    Successfully tagged sentinel:v1.6.3
    
    root@cicd sentinel]# docker ps -l
    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
    e98ebbf0082f        f9e95128225c        "java -Dserver.port=…"   3 minutes ago       Up 3 minutes        0.0.0.0:8889->8889/tcp   sharp_shockley
    [root@cicd sentinel]# docker update --restart=always e98ebbf0082f
    e98ebbf0082f
    

    image-20200820012822683

  • 相关阅读:
    若依项目上传下载附件实现
    若依项目实现导入功能
    若依项目开发实践
    若依项目人员选择器实现
    springboot打成Jar包后部署至Linux服务器上
    linux下启动tomcat----Cannot find ./catalina.sh
    Linux下更换jdk和配置环境变量
    若依项目分模块集成uflo2
    若依项目模块化开发
    Java中涉及到金额业务的处理
  • 原文地址:https://www.cnblogs.com/dalianpai/p/13532822.html
Copyright © 2011-2022 走看看