zoukankan      html  css  js  c++  java
  • 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"]

  • 相关阅读:
    认识Java数组(一)
    Java之定时任务详解
    Java三大特征之多态(三)
    Java三大特征之继承(二)
    Java三大特征之封装(一)
    eclipse常用快捷键汇总
    JDK动态代理
    Java代理模式——静态代理模式
    CRISPR/Cas9基因敲除原理及实验建议
    MicroRNA 详解
  • 原文地址:https://www.cnblogs.com/yuruyi/p/11747653.html
Copyright © 2011-2022 走看看