• docker 安装


     1.卸载
    sudo yum remove docker-ce
    $ sudo rm -rf /var/lib/docker

    $ sudo yum remove docker
    docker-client
    docker-client-latest
    docker-common
    docker-latest
    docker-latest-logrotate
    docker-logrotate
    docker-engine

    2.安装

    $ sudo yum install -y yum-utils
    device-mapper-persistent-data
    lvm2


    3.升级

    yum -y upgrade

    java 配置docker插件

    <build>
    <plugins>
    <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    </plugin>
    <!-- Docker maven plugin -->
    <plugin>
    <groupId>com.spotify</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>1.0.0</version>
    <configuration>
    <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
    <dockerDirectory>src/main/docker</dockerDirectory>
    <resources>
    <resource>
    <targetPath>/</targetPath>
    <directory>${project.build.directory}</directory>
    <include>${project.build.finalName}.jar</include>
    </resource>
    </resources>
    </configuration>
    </plugin>

    </build>
    <!-- Docker maven plugin -->
    </plugins>
    </build>

    Dockerfile  配置


    FROM daocloud.io/library/java:openjdk-8u40


    VOLUME /tmp


    ADD datav-eureka-0.0.1-SNAPSHOT.jar app.jar


    ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
    EXPOSE 8761


    FROM centos

     MAINTAINER yaolin

     COPY jdk1.7.0_79    jdk1.7.0_79
     ADD websocket.jar app.jar

     ENV JAVA_HOME=/jdk1.7.0_79
     ENV PATH=$JAVA_HOME/bin:$PATH

    ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
     
    EXPOSE 8080 

     ENTRYPOINT ["java","-jar","/app.jar"]

  • 相关阅读:
    【转】Oracle中的decode在mysql中的等价实现
    Perhaps you are running on a JRE rather than a JDK
    iisapp -a命令出现 :此脚本不能与WScript工作
    HDU 6070 线段树
    HDU 1853 MCMF
    Codeforces 7C 扩展欧几里得
    HDU 5675 智慧数
    Lucas 大组合数
    bzoj 2179 FFT
    POJ 1155 树形背包
  • 原文地址:https://www.cnblogs.com/yuruyi/p/11747653.html
Copyright © 2020-2023  润新知